|
MCCI TweetNaCl
TweetNaCl library adapted for embedded use
|
Collaboration diagram for Authenticated encryption:Data Structures | |
| struct | mcci_tweetnacl_box_beforenm_t |
| Reference structure for precomputation bytes for box. More... | |
| struct | mcci_tweetnacl_box_cipherzero_t |
| Reference structure for bytes required to be zero at front of cihper text. More... | |
| struct | mcci_tweetnacl_box_messagezero_t |
| Reference structure for bytes required to be zero at front of plaintext. More... | |
| struct | mcci_tweetnacl_box_nonce_t |
| Reference structure for nonce bytes for box. More... | |
| struct | mcci_tweetnacl_box_privatekey_t |
| Reference structure for private key. More... | |
| struct | mcci_tweetnacl_box_publickey_t |
| Reference structure for public key. More... | |
Functions | |
| static mcci_tweetnacl_result_t | mcci_tweetnacl_box (unsigned char *pCipherText, const unsigned char *pPlainText, size_t sizeText, const mcci_tweetnacl_box_nonce_t *pNonce, const mcci_tweetnacl_box_publickey_t *pPublicKey, const mcci_tweetnacl_box_privatekey_t *pPrivateKey) |
| Public-key authenticated encryption. More... | |
| static mcci_tweetnacl_result_t | mcci_tweetnacl_box_afternm (unsigned char *pCipherText, const unsigned char *pPlainText, size_t sizeText, const mcci_tweetnacl_box_nonce_t *pNonce, const mcci_tweetnacl_box_beforenm_t *pPrecomputed) |
| Public-key authenticated encryption (precomputed) More... | |
| static void | mcci_tweetnacl_box_beforenm (mcci_tweetnacl_box_beforenm_t *k, const mcci_tweetnacl_box_publickey_t *pPublicKey, const mcci_tweetnacl_box_privatekey_t *pPrivateKey) |
| Precompute for public-key authenticated cryptographic operations. More... | |
| mcci_tweetnacl_randombytes_error_t | mcci_tweetnacl_box_keypair (mcci_tweetnacl_box_publickey_t *pPublicKey, mcci_tweetnacl_box_privatekey_t *pPrivateKey) |
| Generate a public/private key pair. More... | |
| static mcci_tweetnacl_result_t | mcci_tweetnacl_box_open (unsigned char *pPlainText, const unsigned char *pCipherText, size_t sizeText, const mcci_tweetnacl_box_nonce_t *pNonce, const mcci_tweetnacl_box_publickey_t *pPublicKey, const mcci_tweetnacl_box_privatekey_t *pPrivateKey) |
| Public-key authenticated decryption. More... | |
| static mcci_tweetnacl_result_t | mcci_tweetnacl_box_open_afternm (unsigned char *pPlainText, const unsigned char *pCipherText, size_t sizeText, const mcci_tweetnacl_box_nonce_t *pNonce, const mcci_tweetnacl_box_beforenm_t *pPrecomputed) |
| Public-key authenticated decryption (precomputed)) More... | |
|
inlinestatic |
Public-key authenticated encryption.
| [out] | pCipherText | pointer to buffer of size sizeText bytes. |
| [in] | pPlainText | pointer to buffer of size sizeText bytes. |
| [in] | sizeText | size of the output text buffer |
| [in] | pNonce | pointer to 24-byte nonce |
| [in] | pPublicKey | pointer to 32-byte public key of receiver |
| [in] | pPrivateKey | pointer to 32-byte private key of sender |
pPlainText must start with a string of sizeof(mcci_tweetnacl_box_messagezero_t::bytes) bytes of zero. The first sizeof(mcci_tweetnacl_box_cipherzero_t::bytes) bytes of pCipherText will be zero. Thus, the real ciphertext data is from pCipherText + sizeof(mcci_tweetnacl_box_cipherzero_t::bytes) to pCihperText + sizeText - 1.Definition at line 238 of file mcci_tweetnacl_box.h.
References mcci_tweetnacl_box_publickey_t::bytes, mcci_tweetnacl_box_privatekey_t::bytes, and mcci_tweetnacl_box_nonce_t::bytes.
|
inlinestatic |
Public-key authenticated encryption (precomputed)
| [out] | pCipherText | pointer to buffer of size sizeText bytes. |
| [in] | pPlainText | pointer to buffer of size sizeText bytes. |
| [in] | sizeText | size of the output text buffer |
| [in] | pNonce | pointer to 24-byte nonce |
| [in] | pPrecomputed | pointer to 32-byte precomputed buffer. |
pPlainText must start with a string of sizeof(mcci_tweetnacl_box_messagezero_t::bytes) bytes of zero. The first sizeof(mcci_tweetnacl_box_cipherzero_t::bytes) bytes of pCipherText will be zero. Thus, the real ciphertext data is from pCipherText + sizeof(mcci_tweetnacl_box_cipherzero_t::bytes) to pCipherText + sizeText - 1.Definition at line 157 of file mcci_tweetnacl_box.h.
References mcci_tweetnacl_box_nonce_t::bytes, and mcci_tweetnacl_box_beforenm_t::bytes.
|
inlinestatic |
Precompute for public-key authenticated cryptographic operations.
| [out] | k | is set to the context |
| [in] | pPublicKey,pPrivateKey | are the public and private keys to be used for this operation. |
Definition at line 119 of file mcci_tweetnacl_box.h.
References mcci_tweetnacl_box_publickey_t::bytes, mcci_tweetnacl_box_privatekey_t::bytes, and mcci_tweetnacl_box_beforenm_t::bytes.
| mcci_tweetnacl_randombytes_error_t mcci_tweetnacl_box_keypair | ( | mcci_tweetnacl_box_publickey_t * | pPublicKey, |
| mcci_tweetnacl_box_privatekey_t * | pPrivateKey | ||
| ) |
Generate a public/private key pair.
| [out] | pPublicKey | is set to the public key |
| [in] | pPrivateKey | is set to the private key |
|
inlinestatic |
Public-key authenticated decryption.
| [out] | pPlainText | pointer to buffer of size sizeText bytes. |
| [in] | pCipherText | pointer to buffer of size sizeText bytes. |
| [in] | sizeText | size of the output text buffer |
| [in] | pNonce | pointer to 24-byte nonce |
| [in] | pPublicKey | pointer to 32-byte public key of sender |
| [in] | pPrivateKey | pointer to 32-byte private key of receiver |
pCipherText must start with a string of sizeof(mcci_tweetnacl_secretbox_cipherzero_t::bytes) bytes of zero. The first sizeof(mcci_tweetnacl_secretbox_messagezero_t::bytes) bytes of pPlainText will be zero. Thus, the real plaintext data is from pPlainText + sizeof(mcci_tweetnacl_secretbox_messagezero_t::bytes) to pPlainText + sizeText - 1.Definition at line 281 of file mcci_tweetnacl_box.h.
References mcci_tweetnacl_box_publickey_t::bytes, mcci_tweetnacl_box_privatekey_t::bytes, and mcci_tweetnacl_box_nonce_t::bytes.
|
inlinestatic |
Public-key authenticated decryption (precomputed))
| [out] | pPlainText | pointer to buffer of size sizeText bytes. |
| [in] | pCipherText | pointer to buffer of size sizeText bytes. |
| [in] | sizeText | size of the output text buffer |
| [in] | pNonce | pointer to 24-byte nonce |
| [in] | pPrecomputed | pointer to 32-byte precomputed buffer. |
pCipherText must start with a string of sizeof(mcci_tweetnacl_box_cipherzero_t::bytes) bytes of zero. The first sizeof(mcci_tweetnacl_box_messagezero_t::bytes) bytes of pPlainText will be zero. Thus, the real plaintext data is from pPlainText + sizeof(mcci_tweetnacl_box_messagezero_t::bytes) to pPlainText + sizeText - 1.Definition at line 197 of file mcci_tweetnacl_box.h.
References mcci_tweetnacl_box_nonce_t::bytes, and mcci_tweetnacl_box_beforenm_t::bytes.