Implement AEAD-ChaCha20-Poly1305.

This implementation is based off the description in RFC 7539.

The ChaCha20 code is also updated to provide a means of generating
keystream blocks with arbitrary counter values. This is used to
generated the one-time Poly1305 key in the AEAD construction.
This commit is contained in:
Daniel King 2016-05-17 14:43:01 -03:00 committed by Manuel Pégourié-Gonnard
parent adc32c0b50
commit b8025c5826
15 changed files with 954 additions and 32 deletions

View file

@ -269,6 +269,7 @@
* digests and ciphers instead.
*
*/
//#define MBEDTLS_AEAD_CHACHA20_POLY1305_ALT
//#define MBEDTLS_AES_ALT
//#define MBEDTLS_ARC4_ALT
//#define MBEDTLS_BLOWFISH_ALT
@ -1688,6 +1689,17 @@
*/
#define MBEDTLS_AES_C
/**
* \def MBEDTLS_AEAD_CHACHA20_POLY1305_C
*
* Enable the ChaCha20-Poly1305 AEAD algorithm.
*
* Module: library/aead_chacha20_poly1305.c
*
* This module requires: MBEDTLS_CHACHA20_C, MBEDTLS_POLY1305_C
*/
#define MBEDTLS_AEAD_CHACHA20_POLY1305_C
/**
* \def MBEDTLS_ARC4_C
*
@ -1837,6 +1849,16 @@
*/
#define MBEDTLS_CAMELLIA_C
/**
* \def MBEDTLS_CHACHA20_C
*
* Enable the ChaCha20 block cipher.
*
* Module: library/chacha20.c
* Caller: library/aead_chacha20_poly1305.c
*/
#define MBEDTLS_CHACHA20_C
/**
* \def MBEDTLS_CCM_C
*
@ -2405,6 +2427,7 @@
* Enable the Poly1305 MAC algorithm.
*
* Module: library/poly1305.c
* Caller: library/aead_chacha20_poly1305.c
*/
#define MBEDTLS_POLY1305_C