gnunet-android

GNUnet for Android
Log | Files | Refs | README

crypto_stream_salsa208.h (1731B)


      1 #ifndef crypto_stream_salsa208_H
      2 #define crypto_stream_salsa208_H
      3 
      4 /*
      5  *  WARNING: This is just a stream cipher. It is NOT authenticated encryption.
      6  *  While it provides some protection against eavesdropping, it does NOT
      7  *  provide any security against active attacks.
      8  *  Unless you know what you're doing, what you are looking for is probably
      9  *  the crypto_box functions.
     10  */
     11 
     12 #include <stddef.h>
     13 #include "export.h"
     14 
     15 #ifdef __cplusplus
     16 # ifdef __GNUC__
     17 #  pragma GCC diagnostic ignored "-Wlong-long"
     18 # endif
     19 extern "C" {
     20 #endif
     21 
     22 #define crypto_stream_salsa208_KEYBYTES 32U
     23 SODIUM_EXPORT
     24 size_t crypto_stream_salsa208_keybytes(void)
     25             __attribute__ ((deprecated));
     26 
     27 #define crypto_stream_salsa208_NONCEBYTES 8U
     28 SODIUM_EXPORT
     29 size_t crypto_stream_salsa208_noncebytes(void)
     30             __attribute__ ((deprecated));
     31 
     32 #define crypto_stream_salsa208_MESSAGEBYTES_MAX SODIUM_SIZE_MAX
     33     SODIUM_EXPORT
     34 size_t crypto_stream_salsa208_messagebytes_max(void)
     35             __attribute__ ((deprecated));
     36 
     37 SODIUM_EXPORT
     38 int crypto_stream_salsa208(unsigned char *c, unsigned long long clen,
     39                            const unsigned char *n, const unsigned char *k)
     40             __attribute__ ((deprecated)) __attribute__ ((nonnull));
     41 
     42 SODIUM_EXPORT
     43 int crypto_stream_salsa208_xor(unsigned char *c, const unsigned char *m,
     44                                unsigned long long mlen, const unsigned char *n,
     45                                const unsigned char *k)
     46             __attribute__ ((deprecated)) __attribute__ ((nonnull));
     47 
     48 SODIUM_EXPORT
     49 void crypto_stream_salsa208_keygen(unsigned char k[crypto_stream_salsa208_KEYBYTES])
     50             __attribute__ ((deprecated)) __attribute__ ((nonnull));
     51 
     52 #ifdef __cplusplus
     53 }
     54 #endif
     55 
     56 #endif