Documentation
¶
Overview ¶
Package xsecretbox implements encryption/decryption of a message using specified keys.
Index ¶
Constants ¶
View Source
const ( // KeySize is the size of the encryption key in bytes. KeySize = chacha20.KeySize // NonceSize is the size of the nonce in bytes. NonceSize = chacha20.NonceSizeX // TagSize is the size of the authentication tag in bytes. TagSize = poly1305.TagSize // BlockSize is the size of the cipher block in bytes. BlockSize = 64 )
Variables ¶
This section is empty.
Functions ¶
func Open ¶
Open decrypts and authenticates the box using the XChaCha20-Poly1305 algorithm, appending the result to the out parameter. nonce must be NonceSize elements long. key must be KeySize elements long.
func Seal ¶
Seal encrypts and authenticates message using XChaCha20-Poly1305 and appends the result to out. nonce must be NonceSize long. key must be KeySize long.
func SharedKey ¶
func SharedKey( secretKey [curve25519.ScalarSize]byte, publicKey [curve25519.PointSize]byte, ) (sharedKey [KeySize]byte, err error)
SharedKey computes a shared secret compatible with the one used by 'crypto_box_xchacha20poly1305'.
TODO(f.setarakov): Find out what is 'crypto_box_xchacha20poly1305'.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.