Versions in this module Expand all Collapse all v0 v0.8.3 Feb 26, 2018 v0.8.2 Feb 17, 2018 v0.8.1 Dec 27, 2017 v0.8.0 Nov 26, 2017 Changes in this version + func NewRandomNonce() []byte type Key + func (k *Key) NonceSize() int + func (k *Key) Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) + func (k *Key) Overhead() int + func (k *Key) Seal(dst, nonce, plaintext, additionalData []byte) []byte + type Params struct + N int + P int + R int v0.7.3 Sep 20, 2017 v0.7.2 Sep 13, 2017 Changes in this version + const Extension + var DefaultKDFParams = KDFParams + var ErrInvalidCiphertext = errors.New("invalid ciphertext, same slice used for plaintext") + var ErrUnauthenticated = errors.New("ciphertext verification failed") + func NewSalt() ([]byte, error) + type EncryptionKey [32]byte + func (k *EncryptionKey) MarshalJSON() ([]byte, error) + func (k *EncryptionKey) UnmarshalJSON(data []byte) error + func (k *EncryptionKey) Valid() bool + type KDFParams struct + N int + P int + R int + func Calibrate(timeout time.Duration, memory int) (KDFParams, error) + type Key struct + func KDF(p KDFParams, salt []byte, password string) (*Key, error) + func NewRandomKey() *Key + func (k *Key) Decrypt(plaintext []byte, ciphertextWithMac []byte) (int, error) + func (k *Key) Encrypt(ciphertext []byte, plaintext []byte) ([]byte, error) + func (k *Key) Valid() bool + type MACKey struct + K [16]byte + R [16]byte + func (m *MACKey) MarshalJSON() ([]byte, error) + func (m *MACKey) UnmarshalJSON(data []byte) error + func (m *MACKey) Valid() bool