Documentation ¶
Index ¶
Constants ¶
View Source
const ( KeyLength = chacha20poly1305.KeySize CipherTextMinLength = chacha20poly1305.NonceSize + chacha20poly1305.Overhead )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cipher ¶
type Cipher struct {
// contains filtered or unexported fields
}
Cipher is a wrapper around the AEAD interface from the golang.org/x/crypto/chacha20poly1305 package.
func New ¶
New returns a new Cipher instance. If a Cipher instance with the same key has already been created, it will be returned instead.
func (*Cipher) NewDecryptingReader ¶
NewDecryptingReader returns a new io.ReadCloser that decrypts src with the cipher
func (*Cipher) NewEncryptingWriter ¶
NewEncryptingWriter returns a new io.WriteCloser that encrypts data with the cipher and writes to dst.
Click to show internal directories.
Click to hide internal directories.