The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/libsodium/src/libsodium/include/sodium/crypto_stream_salsa20.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #ifndef crypto_stream_salsa20_H
    2 #define crypto_stream_salsa20_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 <stdint.h>
   14 #include "export.h"
   15 
   16 #ifdef __cplusplus
   17 # ifdef __GNUC__
   18 #  pragma GCC diagnostic ignored "-Wlong-long"
   19 # endif
   20 extern "C" {
   21 #endif
   22 
   23 #define crypto_stream_salsa20_KEYBYTES 32U
   24 SODIUM_EXPORT
   25 size_t crypto_stream_salsa20_keybytes(void);
   26 
   27 #define crypto_stream_salsa20_NONCEBYTES 8U
   28 SODIUM_EXPORT
   29 size_t crypto_stream_salsa20_noncebytes(void);
   30 
   31 #define crypto_stream_salsa20_MESSAGEBYTES_MAX SODIUM_SIZE_MAX
   32 SODIUM_EXPORT
   33 size_t crypto_stream_salsa20_messagebytes_max(void);
   34 
   35 SODIUM_EXPORT
   36 int crypto_stream_salsa20(unsigned char *c, unsigned long long clen,
   37                           const unsigned char *n, const unsigned char *k);
   38 
   39 SODIUM_EXPORT
   40 int crypto_stream_salsa20_xor(unsigned char *c, const unsigned char *m,
   41                               unsigned long long mlen, const unsigned char *n,
   42                               const unsigned char *k);
   43 
   44 SODIUM_EXPORT
   45 int crypto_stream_salsa20_xor_ic(unsigned char *c, const unsigned char *m,
   46                                  unsigned long long mlen,
   47                                  const unsigned char *n, uint64_t ic,
   48                                  const unsigned char *k);
   49 
   50 SODIUM_EXPORT
   51 void crypto_stream_salsa20_keygen(unsigned char k[crypto_stream_salsa20_KEYBYTES]);
   52 
   53 #ifdef __cplusplus
   54 }
   55 #endif
   56 
   57 #endif

Cache object: 40266cfe99e3f4b85448604ebbf0f43b


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.