Warning, file /include/sodium/crypto_aead_xchacha20poly1305.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_aead_xchacha20poly1305_H
0002 #define crypto_aead_xchacha20poly1305_H
0003
0004 #include <stddef.h>
0005 #include "export.h"
0006
0007 #ifdef __cplusplus
0008 # ifdef __GNUC__
0009 # pragma GCC diagnostic ignored "-Wlong-long"
0010 # endif
0011 extern "C" {
0012 #endif
0013
0014 #define crypto_aead_xchacha20poly1305_ietf_KEYBYTES 32U
0015 SODIUM_EXPORT
0016 size_t crypto_aead_xchacha20poly1305_ietf_keybytes(void);
0017
0018 #define crypto_aead_xchacha20poly1305_ietf_NSECBYTES 0U
0019 SODIUM_EXPORT
0020 size_t crypto_aead_xchacha20poly1305_ietf_nsecbytes(void);
0021
0022 #define crypto_aead_xchacha20poly1305_ietf_NPUBBYTES 24U
0023 SODIUM_EXPORT
0024 size_t crypto_aead_xchacha20poly1305_ietf_npubbytes(void);
0025
0026 #define crypto_aead_xchacha20poly1305_ietf_ABYTES 16U
0027 SODIUM_EXPORT
0028 size_t crypto_aead_xchacha20poly1305_ietf_abytes(void);
0029
0030 #define crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX \
0031 (SODIUM_SIZE_MAX - crypto_aead_xchacha20poly1305_ietf_ABYTES)
0032 SODIUM_EXPORT
0033 size_t crypto_aead_xchacha20poly1305_ietf_messagebytes_max(void);
0034
0035 SODIUM_EXPORT
0036 int crypto_aead_xchacha20poly1305_ietf_encrypt(unsigned char *c,
0037 unsigned long long *clen_p,
0038 const unsigned char *m,
0039 unsigned long long mlen,
0040 const unsigned char *ad,
0041 unsigned long long adlen,
0042 const unsigned char *nsec,
0043 const unsigned char *npub,
0044 const unsigned char *k)
0045 __attribute__ ((nonnull(1, 8, 9)));
0046
0047 SODIUM_EXPORT
0048 int crypto_aead_xchacha20poly1305_ietf_decrypt(unsigned char *m,
0049 unsigned long long *mlen_p,
0050 unsigned char *nsec,
0051 const unsigned char *c,
0052 unsigned long long clen,
0053 const unsigned char *ad,
0054 unsigned long long adlen,
0055 const unsigned char *npub,
0056 const unsigned char *k)
0057 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(4, 8, 9)));
0058
0059 SODIUM_EXPORT
0060 int crypto_aead_xchacha20poly1305_ietf_encrypt_detached(unsigned char *c,
0061 unsigned char *mac,
0062 unsigned long long *maclen_p,
0063 const unsigned char *m,
0064 unsigned long long mlen,
0065 const unsigned char *ad,
0066 unsigned long long adlen,
0067 const unsigned char *nsec,
0068 const unsigned char *npub,
0069 const unsigned char *k)
0070 __attribute__ ((nonnull(1, 2, 9, 10)));
0071
0072 SODIUM_EXPORT
0073 int crypto_aead_xchacha20poly1305_ietf_decrypt_detached(unsigned char *m,
0074 unsigned char *nsec,
0075 const unsigned char *c,
0076 unsigned long long clen,
0077 const unsigned char *mac,
0078 const unsigned char *ad,
0079 unsigned long long adlen,
0080 const unsigned char *npub,
0081 const unsigned char *k)
0082 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(3, 5, 8, 9)));
0083
0084 SODIUM_EXPORT
0085 void crypto_aead_xchacha20poly1305_ietf_keygen(unsigned char k[crypto_aead_xchacha20poly1305_ietf_KEYBYTES])
0086 __attribute__ ((nonnull));
0087
0088
0089
0090 #define crypto_aead_xchacha20poly1305_IETF_KEYBYTES crypto_aead_xchacha20poly1305_ietf_KEYBYTES
0091 #define crypto_aead_xchacha20poly1305_IETF_NSECBYTES crypto_aead_xchacha20poly1305_ietf_NSECBYTES
0092 #define crypto_aead_xchacha20poly1305_IETF_NPUBBYTES crypto_aead_xchacha20poly1305_ietf_NPUBBYTES
0093 #define crypto_aead_xchacha20poly1305_IETF_ABYTES crypto_aead_xchacha20poly1305_ietf_ABYTES
0094 #define crypto_aead_xchacha20poly1305_IETF_MESSAGEBYTES_MAX crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX
0095
0096 #ifdef __cplusplus
0097 }
0098 #endif
0099
0100 #endif