Documentation
¶
Index ¶
- Variables
- func NewConn(c net.Conn, ciph Cipher) net.Conn
- func NewPacketConn(c net.PacketConn, ciph Cipher) net.PacketConn
- func NewReader(r io.Reader, s cipher.Stream) io.Reader
- func NewWriter(w io.Writer, s cipher.Stream) io.Writer
- func Pack(dst, plaintext []byte, s Cipher) ([]byte, error)
- func Unpack(dst, pkt []byte, s Cipher) ([]byte, error)
- type Cipher
- type Conn
- type KeySizeError
- type PacketConn
- type Reader
- 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 {
IVSize() int
Encrypter(iv []byte) cipher.Stream
Decrypter(iv []byte) cipher.Stream
}
func Chacha20IETF ¶
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
}
Click to show internal directories.
Click to hide internal directories.