1 2 #include "crypto_box.h" 3 4 size_t 5 crypto_box_seedbytes(void) 6 { 7 return crypto_box_SEEDBYTES; 8 } 9 10 size_t 11 crypto_box_publickeybytes(void) 12 { 13 return crypto_box_PUBLICKEYBYTES; 14 } 15 16 size_t 17 crypto_box_secretkeybytes(void) 18 { 19 return crypto_box_SECRETKEYBYTES; 20 } 21 22 size_t 23 crypto_box_beforenmbytes(void) 24 { 25 return crypto_box_BEFORENMBYTES; 26 } 27 28 size_t 29 crypto_box_noncebytes(void) 30 { 31 return crypto_box_NONCEBYTES; 32 } 33 34 size_t 35 crypto_box_zerobytes(void) 36 { 37 return crypto_box_ZEROBYTES; 38 } 39 40 size_t 41 crypto_box_boxzerobytes(void) 42 { 43 return crypto_box_BOXZEROBYTES; 44 } 45 46 size_t 47 crypto_box_macbytes(void) 48 { 49 return crypto_box_MACBYTES; 50 } 51 52 size_t 53 crypto_box_messagebytes_max(void) 54 { 55 return crypto_box_MESSAGEBYTES_MAX; 56 } 57 58 const char * 59 crypto_box_primitive(void) 60 { 61 return crypto_box_PRIMITIVE; 62 } 63 64 int 65 crypto_box_seed_keypair(unsigned char *pk, unsigned char *sk, 66 const unsigned char *seed) 67 { 68 return crypto_box_curve25519xsalsa20poly1305_seed_keypair(pk, sk, seed); 69 } 70 71 int 72 crypto_box_keypair(unsigned char *pk, unsigned char *sk) 73 { 74 return crypto_box_curve25519xsalsa20poly1305_keypair(pk, sk); 75 } 76 77 int 78 crypto_box_beforenm(unsigned char *k, const unsigned char *pk, 79 const unsigned char *sk) 80 { 81 return crypto_box_curve25519xsalsa20poly1305_beforenm(k, pk, sk); 82 } 83 84 int 85 crypto_box_afternm(unsigned char *c, const unsigned char *m, 86 unsigned long long mlen, const unsigned char *n, 87 const unsigned char *k) 88 { 89 return crypto_box_curve25519xsalsa20poly1305_afternm(c, m, mlen, n, k); 90 } 91 92 int 93 crypto_box_open_afternm(unsigned char *m, const unsigned char *c, 94 unsigned long long clen, const unsigned char *n, 95 const unsigned char *k) 96 { 97 return crypto_box_curve25519xsalsa20poly1305_open_afternm(m, c, clen, n, k); 98 } 99 100 int 101 crypto_box(unsigned char *c, const unsigned char *m, 102 unsigned long long mlen, const unsigned char *n, 103 const unsigned char *pk, const unsigned char *sk) 104 { 105 return crypto_box_curve25519xsalsa20poly1305(c, m, mlen, n, pk, sk); 106 } 107 108 int 109 crypto_box_open(unsigned char *m, const unsigned char *c, 110 unsigned long long clen, const unsigned char *n, 111 const unsigned char *pk, const unsigned char *sk) 112 { 113 return crypto_box_curve25519xsalsa20poly1305_open(m, c, clen, n, pk, sk); 114 } 115