48 #ifndef __BOLOS_SODIUM_H__
50 #define __BOLOS_SODIUM_H__
52 #define crypto_secretbox_MACBYTES 16
53 #define crypto_secretbox_NONCEBYTES 24
54 #define crypto_secretbox_KEYBYTES 32
55 #define crypto_auth_KEYBYTES 32
56 #define crypto_auth_BYTES 32
57 #define crypto_box_PUBLICKEYBYTES 32
58 #define crypto_box_SECRETKEYBYTES 32
59 #define crypto_box_NONCEBYTES 24
60 #define crypto_box_MACBYTES 16
61 #define crypto_box_SEALBYTES (crypto_box_PUBLICKEYBYTES + crypto_box_MACBYTES)
62 #define crypto_sign_PUBLICKEYBYTES 32
63 #define crypto_sign_SECRETKEYBYTES 64
64 #define crypto_sign_BYTES 64
88 unsigned long mlen,
const unsigned char *n,
89 const unsigned char *k);
113 unsigned long clen,
const unsigned char *n,
114 const unsigned char *k);
134 int crypto_auth(
unsigned char *out,
const unsigned char *in,
135 unsigned long inlen,
const unsigned char *k);
157 unsigned long inlen,
const unsigned char *k);
199 unsigned long mlen,
const unsigned char *n,
200 const unsigned char *pk,
const unsigned char *sk);
228 unsigned long clen,
const unsigned char *n,
229 const unsigned char *pk,
const unsigned char *sk);
250 unsigned long mlen,
const unsigned char *pk);
275 const unsigned char *pk,
const unsigned char *sk);
313 int crypto_sign(
unsigned char *sm,
unsigned long *smlen_p,
314 const unsigned char *m,
unsigned long mlen,
315 const unsigned char *sk);
339 const unsigned char *sm,
unsigned long smlen,
340 const unsigned char *pk);
343 #endif //__BOLOS_SODIUM_H__
int crypto_auth_verify(const unsigned char *h, const unsigned char *in, unsigned long inlen, const unsigned char *k)
Verify an authentication (HMAC) of a message generated by crypto_auth.
int crypto_box_open_easy(unsigned char *m, const unsigned char *c, unsigned long clen, const unsigned char *n, const unsigned char *pk, const unsigned char *sk)
Decrypt a message encrypted by crypto_box_easy.
int crypto_box_easy(unsigned char *c, const unsigned char *m, unsigned long mlen, const unsigned char *n, const unsigned char *pk, const unsigned char *sk)
Authenticated Encryption (X25519 + XSalsa20 + Poly1305) of a message using an asymmetric keypair...
int crypto_sign(unsigned char *sm, unsigned long *smlen_p, const unsigned char *m, unsigned long mlen, const unsigned char *sk)
Generate a Combined Signature (Ed25519) of a message using an asymmetric keypair. ...
int crypto_sign_open(unsigned char *m, unsigned long *mlen_p, const unsigned char *sm, unsigned long smlen, const unsigned char *pk)
Unwrap a message wrapped by crypto_sign.
int crypto_box_seal_open(unsigned char *m, const unsigned char *c, unsigned long clen, const unsigned char *pk, const unsigned char *sk)
Decrypt a message encrypted by crypto_box_seal.
int crypto_secretbox_easy(unsigned char *c, const unsigned char *m, unsigned long mlen, const unsigned char *n, const unsigned char *k)
Authenticated Encryption (XSalsa20 + Poly1305) of a message using a symmetric key.
int crypto_sign_keypair(unsigned char *pk, unsigned char *sk)
Generate a keypair to be used for Signature with crypto_sign functions.
int crypto_secretbox_open_easy(unsigned char *m, const unsigned char *c, unsigned long clen, const unsigned char *n, const unsigned char *k)
Decrypt a message encrypted by crypto_secretbox_easy.
int crypto_auth(unsigned char *out, const unsigned char *in, unsigned long inlen, const unsigned char *k)
Compute an authentication (HMAC) of a message using a symmetric key.
int crypto_box_seal(unsigned char *c, const unsigned char *m, unsigned long mlen, const unsigned char *pk)
Anonymous encryption (X25519, XSalsa20, Poly1305) of a message using an asymmetric keypair...
int crypto_box_keypair(unsigned char *pk, unsigned char *sk)
Generate a keypair to be used for Authenticated Encryption with crypto_box functions.