Define specific mode for ChachaPoly

The TLS layer is checking for mode, such as GCM, CCM, CBC, STREAM. ChachaPoly
needs to have its own mode, even if it's used just one cipher, in order to
allow consistent handling of mode in the TLS layer.
This commit is contained in:
Manuel Pégourié-Gonnard 2018-06-18 11:14:09 +02:00
parent a18034a8e2
commit f57bf8b467
2 changed files with 2 additions and 1 deletions

View File

@ -186,6 +186,7 @@ typedef enum {
MBEDTLS_MODE_STREAM, /**< The stream cipher mode. */
MBEDTLS_MODE_CCM, /**< The CCM cipher mode. */
MBEDTLS_MODE_XTS, /**< The XTS cipher mode. */
MBEDTLS_MODE_CHACHAPOLY, /**< The ChaCha-Poly cipher mode. */
} mbedtls_cipher_mode_t;
/** Supported cipher padding types. */

View File

@ -2040,7 +2040,7 @@ static const mbedtls_cipher_base_t chachapoly_base_info = {
};
static const mbedtls_cipher_info_t chachapoly_info = {
MBEDTLS_CIPHER_CHACHA20_POLY1305,
MBEDTLS_MODE_NONE,
MBEDTLS_MODE_CHACHAPOLY,
256,
"CHACHA20-POLY1305",
12,