Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/sodium/crypto_secretbox_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_secretbox_xchacha20poly1305_H
0002 #define crypto_secretbox_xchacha20poly1305_H
0003 
0004 #include <stddef.h>
0005 #include "crypto_stream_xchacha20.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_secretbox_xchacha20poly1305_KEYBYTES 32U
0016 SODIUM_EXPORT
0017 size_t crypto_secretbox_xchacha20poly1305_keybytes(void);
0018 
0019 #define crypto_secretbox_xchacha20poly1305_NONCEBYTES 24U
0020 SODIUM_EXPORT
0021 size_t crypto_secretbox_xchacha20poly1305_noncebytes(void);
0022 
0023 #define crypto_secretbox_xchacha20poly1305_MACBYTES 16U
0024 SODIUM_EXPORT
0025 size_t crypto_secretbox_xchacha20poly1305_macbytes(void);
0026 
0027 #define crypto_secretbox_xchacha20poly1305_MESSAGEBYTES_MAX \
0028     (crypto_stream_xchacha20_MESSAGEBYTES_MAX - crypto_secretbox_xchacha20poly1305_MACBYTES)
0029 SODIUM_EXPORT
0030 size_t crypto_secretbox_xchacha20poly1305_messagebytes_max(void);
0031 
0032 SODIUM_EXPORT
0033 int crypto_secretbox_xchacha20poly1305_easy(unsigned char *c,
0034                                             const unsigned char *m,
0035                                             unsigned long long mlen,
0036                                             const unsigned char *n,
0037                                             const unsigned char *k)
0038             __attribute__ ((nonnull(1, 4, 5)));
0039 
0040 SODIUM_EXPORT
0041 int crypto_secretbox_xchacha20poly1305_open_easy(unsigned char *m,
0042                                                  const unsigned char *c,
0043                                                  unsigned long long clen,
0044                                                  const unsigned char *n,
0045                                                  const unsigned char *k)
0046             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5)));
0047 
0048 SODIUM_EXPORT
0049 int crypto_secretbox_xchacha20poly1305_detached(unsigned char *c,
0050                                                 unsigned char *mac,
0051                                                 const unsigned char *m,
0052                                                 unsigned long long mlen,
0053                                                 const unsigned char *n,
0054                                                 const unsigned char *k)
0055             __attribute__ ((nonnull(1, 2, 5, 6)));
0056 
0057 SODIUM_EXPORT
0058 int crypto_secretbox_xchacha20poly1305_open_detached(unsigned char *m,
0059                                                      const unsigned char *c,
0060                                                      const unsigned char *mac,
0061                                                      unsigned long long clen,
0062                                                      const unsigned char *n,
0063                                                      const unsigned char *k)
0064             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 3, 5, 6)));
0065 
0066 #ifdef __cplusplus
0067 }
0068 #endif
0069 
0070 #endif