Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/sodium/crypto_box_curve25519xchacha20poly1305.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 
0002 #ifndef crypto_box_curve25519xchacha20poly1305_H
0003 #define crypto_box_curve25519xchacha20poly1305_H
0004 
0005 #include <stddef.h>
0006 #include "crypto_stream_xchacha20.h"
0007 #include "export.h"
0008 
0009 #ifdef __cplusplus
0010 # ifdef __GNUC__
0011 #  pragma GCC diagnostic ignored "-Wlong-long"
0012 # endif
0013 extern "C" {
0014 #endif
0015 
0016 #define crypto_box_curve25519xchacha20poly1305_SEEDBYTES 32U
0017 SODIUM_EXPORT
0018 size_t crypto_box_curve25519xchacha20poly1305_seedbytes(void);
0019 
0020 #define crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES 32U
0021 SODIUM_EXPORT
0022 size_t crypto_box_curve25519xchacha20poly1305_publickeybytes(void);
0023 
0024 #define crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES 32U
0025 SODIUM_EXPORT
0026 size_t crypto_box_curve25519xchacha20poly1305_secretkeybytes(void);
0027 
0028 #define crypto_box_curve25519xchacha20poly1305_BEFORENMBYTES 32U
0029 SODIUM_EXPORT
0030 size_t crypto_box_curve25519xchacha20poly1305_beforenmbytes(void);
0031 
0032 #define crypto_box_curve25519xchacha20poly1305_NONCEBYTES 24U
0033 SODIUM_EXPORT
0034 size_t crypto_box_curve25519xchacha20poly1305_noncebytes(void);
0035 
0036 #define crypto_box_curve25519xchacha20poly1305_MACBYTES 16U
0037 SODIUM_EXPORT
0038 size_t crypto_box_curve25519xchacha20poly1305_macbytes(void);
0039 
0040 #define crypto_box_curve25519xchacha20poly1305_MESSAGEBYTES_MAX \
0041     (crypto_stream_xchacha20_MESSAGEBYTES_MAX - crypto_box_curve25519xchacha20poly1305_MACBYTES)
0042 SODIUM_EXPORT
0043 size_t crypto_box_curve25519xchacha20poly1305_messagebytes_max(void);
0044 
0045 SODIUM_EXPORT
0046 int crypto_box_curve25519xchacha20poly1305_seed_keypair(unsigned char *pk,
0047                                                         unsigned char *sk,
0048                                                         const unsigned char *seed)
0049             __attribute__ ((nonnull));
0050 
0051 SODIUM_EXPORT
0052 int crypto_box_curve25519xchacha20poly1305_keypair(unsigned char *pk,
0053                                                    unsigned char *sk)
0054             __attribute__ ((nonnull));
0055 
0056 SODIUM_EXPORT
0057 int crypto_box_curve25519xchacha20poly1305_easy(unsigned char *c,
0058                                                 const unsigned char *m,
0059                                                 unsigned long long mlen,
0060                                                 const unsigned char *n,
0061                                                 const unsigned char *pk,
0062                                                 const unsigned char *sk)
0063             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4, 5, 6)));
0064 
0065 SODIUM_EXPORT
0066 int crypto_box_curve25519xchacha20poly1305_open_easy(unsigned char *m,
0067                                                      const unsigned char *c,
0068                                                      unsigned long long clen,
0069                                                      const unsigned char *n,
0070                                                      const unsigned char *pk,
0071                                                      const unsigned char *sk)
0072             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5, 6)));
0073 
0074 SODIUM_EXPORT
0075 int crypto_box_curve25519xchacha20poly1305_detached(unsigned char *c,
0076                                                     unsigned char *mac,
0077                                                     const unsigned char *m,
0078                                                     unsigned long long mlen,
0079                                                     const unsigned char *n,
0080                                                     const unsigned char *pk,
0081                                                     const unsigned char *sk)
0082             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 2, 5, 6, 7)));
0083 
0084 SODIUM_EXPORT
0085 int crypto_box_curve25519xchacha20poly1305_open_detached(unsigned char *m,
0086                                                          const unsigned char *c,
0087                                                          const unsigned char *mac,
0088                                                          unsigned long long clen,
0089                                                          const unsigned char *n,
0090                                                          const unsigned char *pk,
0091                                                          const unsigned char *sk)
0092             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 3, 5, 6, 7)));
0093 
0094 /* -- Precomputation interface -- */
0095 
0096 SODIUM_EXPORT
0097 int crypto_box_curve25519xchacha20poly1305_beforenm(unsigned char *k,
0098                                                     const unsigned char *pk,
0099                                                     const unsigned char *sk)
0100             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
0101 
0102 SODIUM_EXPORT
0103 int crypto_box_curve25519xchacha20poly1305_easy_afternm(unsigned char *c,
0104                                                         const unsigned char *m,
0105                                                         unsigned long long mlen,
0106                                                         const unsigned char *n,
0107                                                         const unsigned char *k)
0108             __attribute__ ((nonnull(1, 4, 5)));
0109 
0110 SODIUM_EXPORT
0111 int crypto_box_curve25519xchacha20poly1305_open_easy_afternm(unsigned char *m,
0112                                                              const unsigned char *c,
0113                                                              unsigned long long clen,
0114                                                              const unsigned char *n,
0115                                                              const unsigned char *k)
0116             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5)));
0117 
0118 SODIUM_EXPORT
0119 int crypto_box_curve25519xchacha20poly1305_detached_afternm(unsigned char *c,
0120                                                             unsigned char *mac,
0121                                                             const unsigned char *m,
0122                                                             unsigned long long mlen,
0123                                                             const unsigned char *n,
0124                                                             const unsigned char *k)
0125             __attribute__ ((nonnull(1, 2, 5, 6)));
0126 
0127 SODIUM_EXPORT
0128 int crypto_box_curve25519xchacha20poly1305_open_detached_afternm(unsigned char *m,
0129                                                                  const unsigned char *c,
0130                                                                  const unsigned char *mac,
0131                                                                  unsigned long long clen,
0132                                                                  const unsigned char *n,
0133                                                                  const unsigned char *k)
0134             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 3, 5, 6)));
0135 
0136 /* -- Ephemeral SK interface -- */
0137 
0138 #define crypto_box_curve25519xchacha20poly1305_SEALBYTES \
0139     (crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES + \
0140      crypto_box_curve25519xchacha20poly1305_MACBYTES)
0141 
0142 SODIUM_EXPORT
0143 size_t crypto_box_curve25519xchacha20poly1305_sealbytes(void);
0144 
0145 SODIUM_EXPORT
0146 int crypto_box_curve25519xchacha20poly1305_seal(unsigned char *c,
0147                                                 const unsigned char *m,
0148                                                 unsigned long long mlen,
0149                                                 const unsigned char *pk)
0150             __attribute__ ((nonnull(1, 4)));
0151 
0152 SODIUM_EXPORT
0153 int crypto_box_curve25519xchacha20poly1305_seal_open(unsigned char *m,
0154                                                      const unsigned char *c,
0155                                                      unsigned long long clen,
0156                                                      const unsigned char *pk,
0157                                                      const unsigned char *sk)
0158             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5)));
0159 
0160 #ifdef __cplusplus
0161 }
0162 #endif
0163 
0164 #endif