MCCI TweetNaCl
TweetNaCl library adapted for embedded use
|
Go to the documentation of this file.
22 #ifndef _mcci_tweetnacl_stream_h_
23 #define _mcci_tweetnacl_stream_h_
51 typedef struct mcci_tweetnacl_stream_key__s
54 unsigned char bytes[32];
58 typedef struct mcci_tweetnacl_stream_nonce_s
61 unsigned char bytes[32];
80 const unsigned char *in,
82 const unsigned char *expansion
85 extern int crypto_core_salsa20_tweet(
unsigned char *,
const unsigned char *,
const unsigned char *,
const unsigned char *);
86 (void) crypto_core_salsa20_tweet(out, in, key->
bytes, expansion);
105 const unsigned char *in,
107 const unsigned char *expansion
110 extern int crypto_core_hsalsa20_tweet(
unsigned char *,
const unsigned char *,
const unsigned char *,
const unsigned char *);
111 (void) crypto_core_hsalsa20_tweet(
135 unsigned char *pOutText,
136 const unsigned char *pInText,
142 extern int crypto_stream_salsa20_tweet_xor(
unsigned char *,
const unsigned char *,
unsigned long long,
const unsigned char *,
const unsigned char *);
143 (void) crypto_stream_salsa20_tweet_xor(
166 unsigned char *pOutText,
172 extern int crypto_stream_salsa20_tweet(
unsigned char *,
unsigned long long,
const unsigned char *,
const unsigned char *);
173 (void) crypto_stream_salsa20_tweet(pOutText, sizeText, pNonce->
bytes, pKey->
bytes);
189 unsigned char *pOutText,
195 extern int crypto_stream_xsalsa20_tweet(
unsigned char *,
unsigned long long,
const unsigned char *,
const unsigned char *);
196 (void) crypto_stream_xsalsa20_tweet(
220 unsigned char *pOutText,
221 const unsigned char *pInText,
227 extern int crypto_stream_xsalsa20_tweet_xor(
unsigned char *,
const unsigned char *,
unsigned long long,
const unsigned char *,
const unsigned char *);
228 (void) crypto_stream_xsalsa20_tweet_xor(
static void mcci_tweetnacl_core_hsalsa20(unsigned char *out, const unsigned char *in, const mcci_tweetnacl_stream_key_t *key, const unsigned char *expansion)
perform a core hash round of Salsa20 encryption.
static void mcci_tweetnacl_stream(unsigned char *pOutText, size_t sizeText, const mcci_tweetnacl_stream_nonce_t *pNonce, const mcci_tweetnacl_stream_key_t *pKey)
Generate stream of crypto bytes.
static void mcci_tweetnacl_stream_salsa20(unsigned char *pOutText, size_t sizeText, const mcci_tweetnacl_stream_nonce_t *pNonce, const mcci_tweetnacl_stream_key_t *pKey)
Generate stream of Salsa20 bytes.
static void mcci_tweetnacl_core_salsa20(unsigned char *out, const unsigned char *in, const mcci_tweetnacl_stream_key_t *key, const unsigned char *expansion)
perform a core hash round of Salsa20 encryption.
static void mcci_tweetnacl_stream_salsa20_xor(unsigned char *pOutText, const unsigned char *pInText, size_t sizeText, const mcci_tweetnacl_stream_nonce_t *pNonce, const mcci_tweetnacl_stream_key_t *pKey)
encrypt or decrypt text using Salsa20
static void mcci_tweetnacl_stream_xor(unsigned char *pOutText, const unsigned char *pInText, size_t sizeText, const mcci_tweetnacl_stream_nonce_t *pNonce, const mcci_tweetnacl_stream_key_t *pKey)
Encrypt or decrypt text (using xsalsa20)