Documentation ¶
Overview ¶
Package shadowstream implements the original Shadowsocks protocol protected by stream cipher.
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 KeySizeError
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrShortPacket = errors.New("short packet")
ErrShortPacket means the packet is too short to be a valid encrypted packet.
Functions ¶
func NewPacketConn ¶
func NewPacketConn(c net.PacketConn, ciph Cipher) net.PacketConn
NewPacketConn wraps a net.PacketConn with stream cipher encryption/decryption.
Types ¶
type Cipher ¶
type Cipher interface { IVSize() int Encrypter(iv []byte) cipher.Stream Decrypter(iv []byte) cipher.Stream }
Cipher generates a pair of stream ciphers for encryption and decryption.
func Chacha20IETF ¶
type KeySizeError ¶
type KeySizeError int
func (KeySizeError) Error ¶
func (e KeySizeError) Error() string
Click to show internal directories.
Click to hide internal directories.