Add ChaCha20 to the Cipher module

This commit is contained in:
Daniel King 2016-05-15 19:56:20 -03:00 committed by Manuel Pégourié-Gonnard
parent 34b822ce7b
commit bd92062269
8 changed files with 231 additions and 4 deletions

View file

@ -86,6 +86,7 @@ typedef enum {
MBEDTLS_CIPHER_ID_CAMELLIA, /**< The Camellia cipher. */
MBEDTLS_CIPHER_ID_BLOWFISH, /**< The Blowfish cipher. */
MBEDTLS_CIPHER_ID_ARC4, /**< The RC4 cipher. */
MBEDTLS_CIPHER_ID_CHACHA20, /**< The Chacha20 cipher. */
} mbedtls_cipher_id_t;
/**
@ -145,6 +146,7 @@ typedef enum {
MBEDTLS_CIPHER_CAMELLIA_128_CCM, /**< Camellia cipher with 128-bit CCM mode. */
MBEDTLS_CIPHER_CAMELLIA_192_CCM, /**< Camellia cipher with 192-bit CCM mode. */
MBEDTLS_CIPHER_CAMELLIA_256_CCM, /**< Camellia cipher with 256-bit CCM mode. */
MBEDTLS_CIPHER_CHACHA20, /**< Chacha20 stream cipher. */
} mbedtls_cipher_type_t;
/** Supported cipher modes. */
@ -190,7 +192,7 @@ enum {
/** Maximum length of any IV, in Bytes. */
#define MBEDTLS_MAX_IV_LENGTH 16
/** Maximum block size of any cipher, in Bytes. */
#define MBEDTLS_MAX_BLOCK_LENGTH 16
#define MBEDTLS_MAX_BLOCK_LENGTH 64
/**
* Base cipher information (opaque struct).