Documentation ¶
Overview ¶
Package aead contains bindings for authenticated encryption with additional data.
Index ¶
- type AEAD
- type AES256GCM
- func (a *AES256GCM) NonceSize() int
- func (a *AES256GCM) Open(dst, nonce, ciphertext, additionalData []byte) (ret []byte, err error)
- func (a *AES256GCM) OpenDetached(dst, nonce, ciphertext, mac, additionalData []byte) (ret []byte, err error)
- func (a *AES256GCM) Overhead() int
- func (a *AES256GCM) Seal(dst, nonce, plaintext, additionalData []byte) (ret []byte)
- func (a *AES256GCM) SealDetached(dst, nonce, plaintext, additionalData []byte) (ret, mac []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AEAD ¶
type AEAD interface { cipher.AEAD // SealDetached encrypts and authenticates plaintext, authenticates the // additional data and appends the result to dst, returning the updated // slice and the authentication code (mac) separately. // The nonce must be NonceSize() bytes long and unique for all time, for a given key. // The mac is Overhead() bytes long. // // The plaintext and dst may alias exactly or not at all. To reuse // plaintext's storage for the encrypted output, use plaintext[:0] as dst. SealDetached(dst, nonce, plaintext, additionalData []byte) ([]byte, []byte) // OpenDetached decrypts a ciphertext, authenticates the additional data using // the autentication code (mac) and, if successful, appends the resulting plaintext // to dst, returning the updated slice. The nonce must be NonceSize() // bytes long and both it and the additional data must match the // value passed to Seal. // // The ciphertext and dst may alias exactly or not at all. To reuse // ciphertext's storage for the decrypted output, use ciphertext[:0] as dst. // // Even if the function fails, the contents of dst, up to its capacity, // may be overwritten. OpenDetached(dst, nonce, ciphertext, mac, additionalData []byte) ([]byte, error) }
AEAD is and extended version of cipher.AEAD
type AES256GCM ¶
type AES256GCM struct {
// contains filtered or unexported fields
}
AES256GCM state struct
func (*AES256GCM) Open ¶
Open decrypts a ciphertext using a nonce and additional data and appends the result to a destination. See aead.AEAD for details.
func (*AES256GCM) OpenDetached ¶
func (a *AES256GCM) OpenDetached(dst, nonce, ciphertext, mac, additionalData []byte) (ret []byte, err error)
OpenDetached decrypts a ciphertext using a nonce, mac and additional data and appends the result to a destination. See aead.AEAD for details.
func (*AES256GCM) Seal ¶
Seal encrypts plaintext using nonce and additional data and appends it to a destination. See aead.AEAD for details.
func (*AES256GCM) SealDetached ¶
SealDetached encrypts plaintext using nonce and additional data and appends it to a destination. See aead.AEAD for details.
Directories ¶
Path | Synopsis |
---|---|
Package aes256gcm contains the libsodium bindings for AES256-GCM.
|
Package aes256gcm contains the libsodium bindings for AES256-GCM. |
Package chacha20poly1305 contains the libsodium bindings for ChaCha20-Poly1305.
|
Package chacha20poly1305 contains the libsodium bindings for ChaCha20-Poly1305. |
Package chacha20poly1305ietf contains the libsodium bindings for the IETF variant of ChaCha20-Poly1305.
|
Package chacha20poly1305ietf contains the libsodium bindings for the IETF variant of ChaCha20-Poly1305. |
Package xchacha20poly1305ietf contains the libsodium bindings for the IETF variant of XChaCha20-Poly1305.
|
Package xchacha20poly1305ietf contains the libsodium bindings for the IETF variant of XChaCha20-Poly1305. |