aead

package
v0.0.0-...-076f017 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrZeroChunk = errors.New("Snell ZERO_CHUNK occurred")

Functions

func NewConn

func NewConn(c net.Conn, ciph Cipher) net.Conn

NewConn wraps a stream-oriented net.Conn with cipher.

func NewConnWithFallback

func NewConnWithFallback(c net.Conn, ciph, fallback Cipher) net.Conn

func NewReader

func NewReader(r io.Reader, aead cipher.AEAD) io.Reader

NewReader wraps an io.Reader with AEAD decryption.

func NewReaderWithFallback

func NewReaderWithFallback(r io.Reader, aead, fallback cipher.AEAD) io.Reader

func NewWriter

func NewWriter(w io.Writer, aead cipher.AEAD) io.Writer

Types

type Cipher

type Cipher interface {
	KeySize() int
	SaltSize() int
	Encrypter(salt []byte) (cipher.AEAD, error)
	Decrypter(salt []byte) (cipher.AEAD, error)
}

func NewAES128GCM

func NewAES128GCM(psk []byte) Cipher

func NewChacha20Poly1305

func NewChacha20Poly1305(psk []byte) Cipher

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL