33 #ifndef MBEDTLS_CHACHAPOLY_H 34 #define MBEDTLS_CHACHAPOLY_H 36 #if !defined(MBEDTLS_CONFIG_FILE) 39 #include MBEDTLS_CONFIG_FILE 45 #define MBEDTLS_ERR_CHACHAPOLY_BAD_STATE -0x0054 46 #define MBEDTLS_ERR_CHACHAPOLY_AUTH_FAILED -0x0056 59 #if !defined(MBEDTLS_CHACHAPOLY_ALT) 75 #include "chachapoly_alt.h" 143 const unsigned char key[32] );
171 const unsigned char nonce[12],
214 const unsigned char *aad,
250 const unsigned char *input,
251 unsigned char *output );
270 unsigned char mac[16] );
303 const unsigned char nonce[12],
304 const unsigned char *aad,
306 const unsigned char *input,
307 unsigned char *output,
308 unsigned char tag[16] );
337 const unsigned char nonce[12],
338 const unsigned char *aad,
340 const unsigned char tag[16],
341 const unsigned char *input,
342 unsigned char *output );
344 #if defined(MBEDTLS_SELF_TEST) 351 int mbedtls_chachapoly_self_test(
int verbose );
Definition: poly1305.h:61
void mbedtls_chachapoly_init(mbedtls_chachapoly_context *ctx)
This function initializes the specified ChaCha20-Poly1305 context.
int mbedtls_chachapoly_update_aad(mbedtls_chachapoly_context *ctx, const unsigned char *aad, size_t aad_len)
This function feeds additional data to be authenticated into an ongoing ChaCha20-Poly1305 operation.
mbedtls_chachapoly_mode_t mode
Definition: chachapoly.h:70
mbedtls_chachapoly_mode_t
Definition: chachapoly.h:52
int mbedtls_chachapoly_finish(mbedtls_chachapoly_context *ctx, unsigned char mac[16])
This function finished the ChaCha20-Poly1305 operation and generates the MAC (authentication tag).
struct mbedtls_chachapoly_context mbedtls_chachapoly_context
This file contains ChaCha20 definitions and functions.
Configuration options (set of defines)
mbedtls_chacha20_context chacha20_ctx
Definition: chachapoly.h:65
int mbedtls_chachapoly_update(mbedtls_chachapoly_context *ctx, size_t len, const unsigned char *input, unsigned char *output)
Thus function feeds data to be encrypted or decrypted into an on-going ChaCha20-Poly1305 operation.
Definition: chachapoly.h:54
int mbedtls_chachapoly_encrypt_and_tag(mbedtls_chachapoly_context *ctx, size_t length, const unsigned char nonce[12], const unsigned char *aad, size_t aad_len, const unsigned char *input, unsigned char *output, unsigned char tag[16])
This function performs a complete ChaCha20-Poly1305 authenticated encryption with the previously-set ...
int mbedtls_chachapoly_setkey(mbedtls_chachapoly_context *ctx, const unsigned char key[32])
This function sets the ChaCha20-Poly1305 symmetric encryption key.
Definition: chachapoly.h:63
uint64_t aad_len
Definition: chachapoly.h:67
Definition: chachapoly.h:55
int state
Definition: chachapoly.h:69
mbedtls_poly1305_context poly1305_ctx
Definition: chachapoly.h:66
int mbedtls_chachapoly_auth_decrypt(mbedtls_chachapoly_context *ctx, size_t length, const unsigned char nonce[12], const unsigned char *aad, size_t aad_len, const unsigned char tag[16], const unsigned char *input, unsigned char *output)
This function performs a complete ChaCha20-Poly1305 authenticated decryption with the previously-set ...
Definition: chacha20.h:61
int mbedtls_chachapoly_starts(mbedtls_chachapoly_context *ctx, const unsigned char nonce[12], mbedtls_chachapoly_mode_t mode)
This function starts a ChaCha20-Poly1305 encryption or decryption operation.
uint64_t ciphertext_len
Definition: chachapoly.h:68
void mbedtls_chachapoly_free(mbedtls_chachapoly_context *ctx)
This function releases and clears the specified ChaCha20-Poly1305 context.
This file contains Poly1305 definitions and functions.