Warning, file /include/sodium/crypto_box.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 #ifndef crypto_box_H
0002 #define crypto_box_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <stddef.h>
0012
0013 #include "crypto_box_curve25519xsalsa20poly1305.h"
0014 #include "export.h"
0015
0016 #ifdef __cplusplus
0017 # ifdef __GNUC__
0018 # pragma GCC diagnostic ignored "-Wlong-long"
0019 # endif
0020 extern "C" {
0021 #endif
0022
0023 #define crypto_box_SEEDBYTES crypto_box_curve25519xsalsa20poly1305_SEEDBYTES
0024 SODIUM_EXPORT
0025 size_t crypto_box_seedbytes(void);
0026
0027 #define crypto_box_PUBLICKEYBYTES crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES
0028 SODIUM_EXPORT
0029 size_t crypto_box_publickeybytes(void);
0030
0031 #define crypto_box_SECRETKEYBYTES crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES
0032 SODIUM_EXPORT
0033 size_t crypto_box_secretkeybytes(void);
0034
0035 #define crypto_box_NONCEBYTES crypto_box_curve25519xsalsa20poly1305_NONCEBYTES
0036 SODIUM_EXPORT
0037 size_t crypto_box_noncebytes(void);
0038
0039 #define crypto_box_MACBYTES crypto_box_curve25519xsalsa20poly1305_MACBYTES
0040 SODIUM_EXPORT
0041 size_t crypto_box_macbytes(void);
0042
0043 #define crypto_box_MESSAGEBYTES_MAX crypto_box_curve25519xsalsa20poly1305_MESSAGEBYTES_MAX
0044 SODIUM_EXPORT
0045 size_t crypto_box_messagebytes_max(void);
0046
0047 #define crypto_box_PRIMITIVE "curve25519xsalsa20poly1305"
0048 SODIUM_EXPORT
0049 const char *crypto_box_primitive(void);
0050
0051 SODIUM_EXPORT
0052 int crypto_box_seed_keypair(unsigned char *pk, unsigned char *sk,
0053 const unsigned char *seed)
0054 __attribute__ ((nonnull));
0055
0056 SODIUM_EXPORT
0057 int crypto_box_keypair(unsigned char *pk, unsigned char *sk)
0058 __attribute__ ((nonnull));
0059
0060 SODIUM_EXPORT
0061 int crypto_box_easy(unsigned char *c, const unsigned char *m,
0062 unsigned long long mlen, const unsigned char *n,
0063 const unsigned char *pk, const unsigned char *sk)
0064 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4, 5, 6)));
0065
0066 SODIUM_EXPORT
0067 int crypto_box_open_easy(unsigned char *m, const unsigned char *c,
0068 unsigned long long clen, const unsigned char *n,
0069 const unsigned char *pk, const unsigned char *sk)
0070 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5, 6)));
0071
0072 SODIUM_EXPORT
0073 int crypto_box_detached(unsigned char *c, unsigned char *mac,
0074 const unsigned char *m, unsigned long long mlen,
0075 const unsigned char *n, const unsigned char *pk,
0076 const unsigned char *sk)
0077 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 2, 5, 6, 7)));
0078
0079 SODIUM_EXPORT
0080 int crypto_box_open_detached(unsigned char *m, const unsigned char *c,
0081 const unsigned char *mac,
0082 unsigned long long clen,
0083 const unsigned char *n,
0084 const unsigned char *pk,
0085 const unsigned char *sk)
0086 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 3, 5, 6, 7)));
0087
0088
0089
0090 #define crypto_box_BEFORENMBYTES crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES
0091 SODIUM_EXPORT
0092 size_t crypto_box_beforenmbytes(void);
0093
0094 SODIUM_EXPORT
0095 int crypto_box_beforenm(unsigned char *k, const unsigned char *pk,
0096 const unsigned char *sk)
0097 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
0098
0099 SODIUM_EXPORT
0100 int crypto_box_easy_afternm(unsigned char *c, const unsigned char *m,
0101 unsigned long long mlen, const unsigned char *n,
0102 const unsigned char *k) __attribute__ ((nonnull(1, 4, 5)));
0103
0104 SODIUM_EXPORT
0105 int crypto_box_open_easy_afternm(unsigned char *m, const unsigned char *c,
0106 unsigned long long clen, const unsigned char *n,
0107 const unsigned char *k)
0108 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5)));
0109
0110 SODIUM_EXPORT
0111 int crypto_box_detached_afternm(unsigned char *c, unsigned char *mac,
0112 const unsigned char *m, unsigned long long mlen,
0113 const unsigned char *n, const unsigned char *k)
0114 __attribute__ ((nonnull(1, 2, 5, 6)));
0115
0116 SODIUM_EXPORT
0117 int crypto_box_open_detached_afternm(unsigned char *m, const unsigned char *c,
0118 const unsigned char *mac,
0119 unsigned long long clen, const unsigned char *n,
0120 const unsigned char *k)
0121 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 3, 5, 6)));
0122
0123
0124
0125 #define crypto_box_SEALBYTES (crypto_box_PUBLICKEYBYTES + crypto_box_MACBYTES)
0126 SODIUM_EXPORT
0127 size_t crypto_box_sealbytes(void);
0128
0129 SODIUM_EXPORT
0130 int crypto_box_seal(unsigned char *c, const unsigned char *m,
0131 unsigned long long mlen, const unsigned char *pk)
0132 __attribute__ ((nonnull(1, 4)));
0133
0134 SODIUM_EXPORT
0135 int crypto_box_seal_open(unsigned char *m, const unsigned char *c,
0136 unsigned long long clen,
0137 const unsigned char *pk, const unsigned char *sk)
0138 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5)));
0139
0140
0141
0142 #define crypto_box_ZEROBYTES crypto_box_curve25519xsalsa20poly1305_ZEROBYTES
0143 SODIUM_EXPORT
0144 size_t crypto_box_zerobytes(void);
0145
0146 #define crypto_box_BOXZEROBYTES crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES
0147 SODIUM_EXPORT
0148 size_t crypto_box_boxzerobytes(void);
0149
0150 SODIUM_EXPORT
0151 int crypto_box(unsigned char *c, const unsigned char *m,
0152 unsigned long long mlen, const unsigned char *n,
0153 const unsigned char *pk, const unsigned char *sk)
0154 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4, 5, 6)));
0155
0156 SODIUM_EXPORT
0157 int crypto_box_open(unsigned char *m, const unsigned char *c,
0158 unsigned long long clen, const unsigned char *n,
0159 const unsigned char *pk, const unsigned char *sk)
0160 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5, 6)));
0161
0162 SODIUM_EXPORT
0163 int crypto_box_afternm(unsigned char *c, const unsigned char *m,
0164 unsigned long long mlen, const unsigned char *n,
0165 const unsigned char *k) __attribute__ ((nonnull(1, 4, 5)));
0166
0167 SODIUM_EXPORT
0168 int crypto_box_open_afternm(unsigned char *m, const unsigned char *c,
0169 unsigned long long clen, const unsigned char *n,
0170 const unsigned char *k)
0171 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5)));
0172
0173 #ifdef __cplusplus
0174 }
0175 #endif
0176
0177 #endif