Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConn ¶
func NewConn(connection net.Conn, aead aeadCipher, saltFilter SaltFilter) net.Conn
NewConn wraps a stream net.Conn connection with a cipher.
func NewPacketConn ¶
func NewPacketConn(connection net.PacketConn, aead aeadCipher, saltFilter SaltFilter) net.PacketConn
NewPacketConn wraps a net.PacketConn with a cipher.
Types ¶
type AEADCipherAdapter ¶ added in v0.3.0
type AEADCipherAdapter struct {
// contains filtered or unexported fields
}
func AESGCM ¶
func AESGCM(preSharedKey []byte) *AEADCipherAdapter
AESGCM creates a new Cipher with a pre-shared key of 16 or 32 bytes.
func Chacha20Poly1305 ¶
func Chacha20Poly1305(preSharedKey []byte) *AEADCipherAdapter
Chacha20Poly1305 creates a new Cipher with a pre-shared key of 32 bytes.
func (*AEADCipherAdapter) Crypt ¶ added in v0.3.0
func (c *AEADCipherAdapter) Crypt(salt []byte) (cipher.AEAD, error)
func (*AEADCipherAdapter) GetSaltSize ¶ added in v0.3.0
func (c *AEADCipherAdapter) GetSaltSize() int
type SaltFilter ¶ added in v0.5.0
SaltFilter is used to mitigate replay attacks by detecting repeated salts.
Click to show internal directories.
Click to hide internal directories.