MCCI TweetNaCl
TweetNaCl library adapted for embedded use
|
Data Structures | |
struct | mcci_tweetnacl_onetimeauth_authenticator_t |
abstract type for crypto authenticators More... | |
struct | mcci_tweetnacl_onetimeauth_key_t |
abstract type for crypto keys More... | |
struct | mcci_tweetnacl_stream_key_t |
abstract type for crypto keys More... | |
struct | mcci_tweetnacl_stream_nonce_t |
abstract type for crypto nonces More... | |
Functions | |
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. More... | |
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. More... | |
static void | mcci_tweetnacl_onetimeauth (mcci_tweetnacl_onetimeauth_authenticator_t *pAuth, const unsigned char *pMessage, size_t nMessage, const mcci_tweetnacl_onetimeauth_key_t *pKey) |
Generate one-time authenticator for a given message and secret key. More... | |
static mcci_tweetnacl_result_t | mcci_tweetnacl_onetimeauth_verify (const mcci_tweetnacl_onetimeauth_authenticator_t *pAuth, const unsigned char *pMessage, size_t nMessage, const mcci_tweetnacl_onetimeauth_key_t *pKey) |
Verify message given one-time authenticator and secret key. More... | |
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. More... | |
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. More... | |
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 More... | |
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) More... | |
|
inlinestatic |
perform a core hash round of Salsa20 encryption.
[out] | out | pointer to a 64-byte buffer |
[in] | in | pointer to a 16-byte input value |
[in] | key | pointer to the 32-byte key |
[in] | expansion | pointer to a 16-byte expansion vector, normally "expand 32-byte k" |
Definition at line 103 of file mcci_tweetnacl_stream.h.
References mcci_tweetnacl_stream_key_t::bytes.
|
inlinestatic |
perform a core hash round of Salsa20 encryption.
[out] | out | pointer to a 64-byte buffer |
[in] | in | pointer to a 16-byte input value |
[in] | key | pointer to the 32-byte key |
[in] | expansion | pointer to a 16-byte expansion vector, normally either "expand 32-byte k" or "expand 16-byte k" |
Definition at line 78 of file mcci_tweetnacl_stream.h.
References mcci_tweetnacl_stream_key_t::bytes.
|
inlinestatic |
Generate one-time authenticator for a given message and secret key.
[out] | pAuth | set to the authenticator code. |
[in] | pMessage | the message to be authenticated. |
[in] | nMessage | number of bytes in the message. |
[in] | pKey | the secret key |
Definition at line 75 of file mcci_tweetnacl_onetimeauth.h.
References mcci_tweetnacl_onetimeauth_key_t::bytes, and mcci_tweetnacl_onetimeauth_authenticator_t::bytes.
|
inlinestatic |
Verify message given one-time authenticator and secret key.
[out] | pAuth | set to the authenticator code. |
[in] | pMessage | the message to be authenticated. |
[in] | nMessage | number of bytes in the message. |
[in] | pKey | the secret key |
Definition at line 104 of file mcci_tweetnacl_onetimeauth.h.
References mcci_tweetnacl_onetimeauth_key_t::bytes, and mcci_tweetnacl_onetimeauth_authenticator_t::bytes.
|
inlinestatic |
Generate stream of crypto bytes.
[out] | pOutText | pointer to buffer of size sizeText bytes. |
[in] | sizeText | size of the output text buffer |
[in] | pNonce | pointer to 8-byte nonce, followed by 8-byte index buffer |
[in] | pKey | pointer to 32-byte key buffer. |
Definition at line 188 of file mcci_tweetnacl_stream.h.
References mcci_tweetnacl_stream_key_t::bytes, and mcci_tweetnacl_stream_nonce_t::bytes.
|
inlinestatic |
Generate stream of Salsa20 bytes.
[out] | pOutText | pointer to buffer of size sizeText bytes. |
[in] | sizeText | size of the input and output text buffers |
[in] | pNonce | pointer to 8-byte nonce buffer |
[in] | pKey | pointer to 32-byte key buffer. |
Definition at line 165 of file mcci_tweetnacl_stream.h.
References mcci_tweetnacl_stream_key_t::bytes, and mcci_tweetnacl_stream_nonce_t::bytes.
|
inlinestatic |
encrypt or decrypt text using Salsa20
[out] | pOutText | pointer to buffer of size sizeText bytes. |
[in] | pInText | pointer to buffer of size sizeText bytes. If NULL, a string of zero bytes will be substituted. |
[in] | sizeText | size of the input and output text buffers |
[in] | pNonce | pointer to 8-byte nonce buffer |
[in] | pKey | pointer to 32-byte key buffer. |
Definition at line 134 of file mcci_tweetnacl_stream.h.
References mcci_tweetnacl_stream_key_t::bytes, and mcci_tweetnacl_stream_nonce_t::bytes.
|
inlinestatic |
Encrypt or decrypt text (using xsalsa20)
[out] | pOutText | pointer to buffer of size sizeText bytes. |
[in] | pInText | pointer to buffer of size sizeText bytes. |
[in] | sizeText | size of the output text buffer |
[in] | pNonce | pointer to 8-byte nonce, followed by 8-byte index buffer |
[in] | pKey | pointer to 32-byte key buffer. |
Definition at line 219 of file mcci_tweetnacl_stream.h.
References mcci_tweetnacl_stream_key_t::bytes, and mcci_tweetnacl_stream_nonce_t::bytes.