MCCI TweetNaCl
TweetNaCl library adapted for embedded use
|
Go to the documentation of this file.
22 #ifndef _mcci_tweetnacl_box_h_
23 #define _mcci_tweetnacl_box_h_
51 typedef struct mcci_tweetnacl_box_publickey_s
53 unsigned char bytes[32];
57 typedef struct mcci_tweetnacl_box_privatekey_s
59 unsigned char bytes[32];
64 typedef struct mcci_tweetnacl_box_messagezero_s
66 unsigned char bytes[32];
70 typedef struct mcci_tweetnacl_box_cipherzero_s
72 unsigned char bytes[16];
76 typedef struct mcci_tweetnacl_box_nonce_s
78 unsigned char bytes[24];
82 typedef struct mcci_tweetnacl_box_beforenm_s
84 unsigned char bytes[32];
125 extern int crypto_box_curve25519xsalsa20poly1305_tweet_beforenm(
unsigned char *,
const unsigned char *,
const unsigned char *);
126 (void) crypto_box_curve25519xsalsa20poly1305_tweet_beforenm(
158 unsigned char *pCipherText,
159 const unsigned char *pPlainText,
165 extern int crypto_box_curve25519xsalsa20poly1305_tweet_afternm(
unsigned char *,
const unsigned char *,
unsigned long long,
const unsigned char *,
const unsigned char *);
166 return crypto_box_curve25519xsalsa20poly1305_tweet_afternm(
198 unsigned char *pPlainText,
199 const unsigned char *pCipherText,
205 extern int crypto_box_curve25519xsalsa20poly1305_tweet_open_afternm(
unsigned char *,
const unsigned char *,
unsigned long long,
const unsigned char *,
const unsigned char *);
206 return crypto_box_curve25519xsalsa20poly1305_tweet_open_afternm(
239 unsigned char *pCipherText,
240 const unsigned char *pPlainText,
247 extern int crypto_box_curve25519xsalsa20poly1305_tweet(
unsigned char *,
const unsigned char *,
unsigned long long,
const unsigned char *,
const unsigned char *,
const unsigned char *);
248 return crypto_box_curve25519xsalsa20poly1305_tweet(
282 unsigned char *pPlainText,
283 const unsigned char *pCipherText,
290 extern int crypto_box_curve25519xsalsa20poly1305_tweet_open(
unsigned char *,
const unsigned char *,
unsigned long long,
const unsigned char *,
const unsigned char *,
const unsigned char *);
291 return crypto_box_curve25519xsalsa20poly1305_tweet_open(
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.
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.
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.
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.
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))
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)