Documentation ¶
Index ¶
- Variables
- func HKDFSHA1(secret, salt, info, outkey []byte)
- func NewConn(c net.Conn, cipher Cipher) net.Conn
- func NewPacketConn(c net.PacketConn, ciph Cipher) net.PacketConn
- func NewReader(r io.Reader, aead cipher.AEAD) io.Reader
- func NewWriter(w io.Writer, aead cipher.AEAD) io.Writer
- func Pack(dst, plaintext []byte, ciph Cipher) ([]byte, error)
- func Unpack(dst, pkt []byte, ciph Cipher) ([]byte, error)
- type Cipher
- type KeySizeError
- type PacketConn
- type Reader
- type StreamConn
- type Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrShortPacket = errors.New("short packet")
Functions ¶
func NewPacketConn ¶
func NewPacketConn(c net.PacketConn, ciph Cipher) net.PacketConn
Types ¶
type Cipher ¶
type Cipher interface { KeySize() int SaltSize() int Encrypter(salt []byte) (cipher.AEAD, error) Decrypter(salt []byte) (cipher.AEAD, error) }
func Chacha20Poly1305 ¶
func XChacha20Poly1305 ¶
type KeySizeError ¶
type KeySizeError int
func (KeySizeError) Error ¶
func (e KeySizeError) Error() string
type PacketConn ¶
type PacketConn struct { net.PacketConn Cipher sync.Mutex // contains filtered or unexported fields }
type StreamConn ¶
Click to show internal directories.
Click to hide internal directories.