Documentation ¶
Index ¶
- Constants
- type Key
- func (k Key) Bytes() []byte
- func (k Key) Decrypt(encrypted []byte) ([]byte, error)
- func (k Key) DecryptWithAuthData(encrypted, authData []byte) ([]byte, error)
- func (k Key) Encrypt(msg []byte) ([]byte, error)
- func (k Key) EncryptWithAuthData(msg, authData []byte) ([]byte, error)
- func (k Key) String() string
Constants ¶
View Source
const ( // KeyLength is the size of the key used by this AEAD, in bytes. KeyLength = 32 // NonceLength is the size of the nonce used with the standard variant of this // AEAD, in bytes. // // Note that this is too short to be safely generated at random if the same // key is reused more than 2³² times. NonceLength = 12 // Overhead is the size of the Poly1305 authentication tag, and the // difference between a ciphertext length and its plaintext. Overhead = 16 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Key ¶
func GenerateKey ¶
func GenerateKey() *Key
func NewKeyFromBytes ¶
func (Key) DecryptWithAuthData ¶
func (Key) EncryptWithAuthData ¶
Click to show internal directories.
Click to hide internal directories.