Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/sodium/crypto_box_curve25519xsalsa20poly1305.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_curve25519xsalsa20poly1305_H
0002 #define crypto_box_curve25519xsalsa20poly1305_H
0003 
0004 #include <stddef.h>
0005 #include "crypto_stream_xsalsa20.h"
0006 #include "export.h"
0007 
0008 #ifdef __cplusplus
0009 # ifdef __GNUC__
0010 #  pragma GCC diagnostic ignored "-Wlong-long"
0011 # endif
0012 extern "C" {
0013 #endif
0014 
0015 #define crypto_box_curve25519xsalsa20poly1305_SEEDBYTES 32U
0016 SODIUM_EXPORT
0017 size_t crypto_box_curve25519xsalsa20poly1305_seedbytes(void);
0018 
0019 #define crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES 32U
0020 SODIUM_EXPORT
0021 size_t crypto_box_curve25519xsalsa20poly1305_publickeybytes(void);
0022 
0023 #define crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES 32U
0024 SODIUM_EXPORT
0025 size_t crypto_box_curve25519xsalsa20poly1305_secretkeybytes(void);
0026 
0027 #define crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES 32U
0028 SODIUM_EXPORT
0029 size_t crypto_box_curve25519xsalsa20poly1305_beforenmbytes(void);
0030 
0031 #define crypto_box_curve25519xsalsa20poly1305_NONCEBYTES 24U
0032 SODIUM_EXPORT
0033 size_t crypto_box_curve25519xsalsa20poly1305_noncebytes(void);
0034 
0035 #define crypto_box_curve25519xsalsa20poly1305_MACBYTES 16U
0036 SODIUM_EXPORT
0037 size_t crypto_box_curve25519xsalsa20poly1305_macbytes(void);
0038 
0039 /* Only for the libsodium API - The NaCl compatibility API would require BOXZEROBYTES extra bytes */
0040 #define crypto_box_curve25519xsalsa20poly1305_MESSAGEBYTES_MAX \
0041     (crypto_stream_xsalsa20_MESSAGEBYTES_MAX - crypto_box_curve25519xsalsa20poly1305_MACBYTES)
0042 SODIUM_EXPORT
0043 size_t crypto_box_curve25519xsalsa20poly1305_messagebytes_max(void);
0044 
0045 SODIUM_EXPORT
0046 int crypto_box_curve25519xsalsa20poly1305_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_curve25519xsalsa20poly1305_keypair(unsigned char *pk,
0053                                                   unsigned char *sk)
0054             __attribute__ ((nonnull));
0055 
0056 SODIUM_EXPORT
0057 int crypto_box_curve25519xsalsa20poly1305_beforenm(unsigned char *k,
0058                                                    const unsigned char *pk,
0059                                                    const unsigned char *sk)
0060             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
0061 
0062 /* -- NaCl compatibility interface ; Requires padding -- */
0063 
0064 #define crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES 16U
0065 SODIUM_EXPORT
0066 size_t crypto_box_curve25519xsalsa20poly1305_boxzerobytes(void);
0067 
0068 #define crypto_box_curve25519xsalsa20poly1305_ZEROBYTES \
0069     (crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES + \
0070      crypto_box_curve25519xsalsa20poly1305_MACBYTES)
0071 SODIUM_EXPORT
0072 size_t crypto_box_curve25519xsalsa20poly1305_zerobytes(void);
0073 
0074 SODIUM_EXPORT
0075 int crypto_box_curve25519xsalsa20poly1305(unsigned char *c,
0076                                           const unsigned char *m,
0077                                           unsigned long long mlen,
0078                                           const unsigned char *n,
0079                                           const unsigned char *pk,
0080                                           const unsigned char *sk)
0081             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4, 5, 6)));
0082 
0083 SODIUM_EXPORT
0084 int crypto_box_curve25519xsalsa20poly1305_open(unsigned char *m,
0085                                                const unsigned char *c,
0086                                                unsigned long long clen,
0087                                                const unsigned char *n,
0088                                                const unsigned char *pk,
0089                                                const unsigned char *sk)
0090             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5, 6)));
0091 
0092 SODIUM_EXPORT
0093 int crypto_box_curve25519xsalsa20poly1305_afternm(unsigned char *c,
0094                                                   const unsigned char *m,
0095                                                   unsigned long long mlen,
0096                                                   const unsigned char *n,
0097                                                   const unsigned char *k)
0098             __attribute__ ((nonnull(1, 4, 5)));
0099 
0100 SODIUM_EXPORT
0101 int crypto_box_curve25519xsalsa20poly1305_open_afternm(unsigned char *m,
0102                                                        const unsigned char *c,
0103                                                        unsigned long long clen,
0104                                                        const unsigned char *n,
0105                                                        const unsigned char *k)
0106             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5)));
0107 
0108 #ifdef __cplusplus
0109 }
0110 #endif
0111 
0112 #endif