Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:40

0001 #ifndef crypto_stream_salsa2012_H
0002 #define crypto_stream_salsa2012_H
0003 
0004 /*
0005  *  WARNING: This is just a stream cipher. It is NOT authenticated encryption.
0006  *  While it provides some protection against eavesdropping, it does NOT
0007  *  provide any security against active attacks.
0008  *  Unless you know what you're doing, what you are looking for is probably
0009  *  the crypto_box functions.
0010  */
0011 
0012 #include <stddef.h>
0013 #include "export.h"
0014 
0015 #ifdef __cplusplus
0016 # ifdef __GNUC__
0017 #  pragma GCC diagnostic ignored "-Wlong-long"
0018 # endif
0019 extern "C" {
0020 #endif
0021 
0022 #define crypto_stream_salsa2012_KEYBYTES 32U
0023 SODIUM_EXPORT
0024 size_t crypto_stream_salsa2012_keybytes(void);
0025 
0026 #define crypto_stream_salsa2012_NONCEBYTES 8U
0027 SODIUM_EXPORT
0028 size_t crypto_stream_salsa2012_noncebytes(void);
0029 
0030 #define crypto_stream_salsa2012_MESSAGEBYTES_MAX SODIUM_SIZE_MAX
0031 SODIUM_EXPORT
0032 size_t crypto_stream_salsa2012_messagebytes_max(void);
0033 
0034 SODIUM_EXPORT
0035 int crypto_stream_salsa2012(unsigned char *c, unsigned long long clen,
0036                             const unsigned char *n, const unsigned char *k)
0037             __attribute__ ((nonnull));
0038 
0039 SODIUM_EXPORT
0040 int crypto_stream_salsa2012_xor(unsigned char *c, const unsigned char *m,
0041                                 unsigned long long mlen, const unsigned char *n,
0042                                 const unsigned char *k)
0043             __attribute__ ((nonnull));
0044 
0045 SODIUM_EXPORT
0046 void crypto_stream_salsa2012_keygen(unsigned char k[crypto_stream_salsa2012_KEYBYTES])
0047             __attribute__ ((nonnull));
0048 
0049 #ifdef __cplusplus
0050 }
0051 #endif
0052 
0053 #endif