Documentation
¶
Overview ¶
Package ciphersuite provides the crypto operations needed for a DTLS CipherSuite
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CBC ¶
type CBC struct {
// contains filtered or unexported fields
}
CBC Provides an API to Encrypt/Decrypt DTLS 1.2 Packets.
func NewCBC ¶
func NewCBC( localKey, localWriteIV, localMac, remoteKey, remoteWriteIV, remoteMac []byte, hashFunc prf.HashFunc, ) (*CBC, error)
NewCBC creates a DTLS CBC Cipher.
func (*CBC) Encrypt ¶
func (c *CBC) Encrypt(pkt *recordlayer.RecordLayer, raw []byte) ([]byte, error)
Encrypt encrypt a DTLS RecordLayer message.
type CCM ¶
type CCM struct {
// contains filtered or unexported fields
}
CCM Provides an API to Encrypt/Decrypt DTLS 1.2 Packets.
func NewCCM ¶
func NewCCM(tagLen CCMTagLen, localKey, localWriteIV, remoteKey, remoteWriteIV []byte) (*CCM, error)
NewCCM creates a DTLS GCM Cipher.
func (*CCM) Encrypt ¶
func (c *CCM) Encrypt(pkt *recordlayer.RecordLayer, raw []byte) ([]byte, error)
Encrypt encrypt a DTLS RecordLayer message.
type ChaCha20Poly1305 ¶ added in v3.1.3
type ChaCha20Poly1305 struct {
// contains filtered or unexported fields
}
ChaCha20Poly1305 Provides an API to Encrypt/Decrypt DTLS 1.2 Packets.
Per RFC 7905, ChaCha20-Poly1305 nonce is formed by XOR-ing the write_IV with the padded 64-bit sequence number (epoch || sequence_number).
func NewChaCha20Poly1305 ¶ added in v3.1.3
func NewChaCha20Poly1305(localKey, localWriteIV, remoteKey, remoteWriteIV []byte) (*ChaCha20Poly1305, error)
NewChaCha20Poly1305 creates a DTLS ChaCha20-Poly1305 Cipher.
func (*ChaCha20Poly1305) Decrypt ¶ added in v3.1.3
func (c *ChaCha20Poly1305) Decrypt(header recordlayer.Header, in []byte) ([]byte, error)
Decrypt decrypts a DTLS RecordLayer message.
func (*ChaCha20Poly1305) Encrypt ¶ added in v3.1.3
func (c *ChaCha20Poly1305) Encrypt(pkt *recordlayer.RecordLayer, raw []byte) ([]byte, error)
Encrypt encrypts a DTLS RecordLayer message.
type GCM ¶
type GCM struct {
// contains filtered or unexported fields
}
GCM Provides an API to Encrypt/Decrypt DTLS 1.2 Packets.
func (*GCM) Encrypt ¶
func (g *GCM) Encrypt(pkt *recordlayer.RecordLayer, raw []byte) ([]byte, error)
Encrypt encrypts a DTLS RecordLayer message.