Constants§
- BOX_
NONCE_ LEN - BOX_
PUBLIC_ KEY_ LEN - BOX_
SECRET_ KEY_ LEN - HASH_
LEN - ONETIMEAUTH_
HASH_ LEN - ONETIMEAUTH_
KEY_ LEN - SECRETBOX_
KEY_ LEN - SECRETBOX_
NONCE_ LEN - SIGN_
LEN - SIGN_
PUBLIC_ KEY_ LEN - SIGN_
SECRET_ KEY_ LEN - STREAM_
XSALS A20_ KEY_ LEN - STREAM_
XSALS A20_ NONCE_ LEN
Functions§
- box_
- Public key authenticated encryption
- box_
afternm - Encrypt an authenticate a message
musing a noncenand a precomuted valuek(frombox_beforenm). - box_
beforenm - By splitting
box_into 2 steps:box_beforenmandbox_afternm, we can more efficiently compute multiple messages that use the same keys. - box_
keypair_ seed - Use
seedto populate thepub_keyandsecret_key.seedshould be uniformly random and generated with a secure random number generator. - box_
open - Decrypt and verify the cipher text
cusing the recievers secret keysk, the senders public keypk, and the noncen. - box_
open_ afternm - Verify and decrypt a cipher text
cusing a noncenand a precomuted valuek(frombox_beforenm). - hash
- Hash the message
m, returning the result inout. - onetimeauth
- Authenticate a message
musing a secret keyk, return the authenticator inout. - onetimeauth_
verify - Check that
his a correct authenticator for messagemunder secret keyk. - reduce
- scalarmult
- Multiply group element
pby an integern. Result is stored inq. - scalarmult_
base - Compute the scalar product of a standard group element and the integer
n. Returns the result inq. - secretbox
- Encrypt and authenticate message
musing noncenand secret keyk. - secretbox_
open - Decrypt and verify cipher text
cusing noncenand secret keyk. - sign_
attached - Sign a message
musing the signers secret keysk - sign_
attached_ open - verify an attached signature
- sign_
keypair_ seed - Generate a signature keypair with a public key
pkand a secret keyskfrom the provided seedseed. - stream_
salsa20 - Fill
c_streamwith bytes derived fromnonceandkey. - stream_
salsa20_ xor - Encrypt
messageintoc_textusingnonceandkeyby xoring message with a stream. - stream_
xsalsa20 - Fill
c_streamwith bytes derived fromnonceandkey. - stream_
xsalsa20_ xor - Encrypt
messageintoc_textusingnonceandkeyby xoring message with a stream.