mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-07 06:42:56 +03:00
ccm/gcm: use BLOCK_CIPHER whenever possible
Prefer BLOCK_CIPHER instead of CIPHER_C whenever it's enabled. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
|
||||
#include "mbedtls/cipher.h"
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_C)
|
||||
#if defined(MBEDTLS_BLOCK_CIPHER_C)
|
||||
#include "mbedtls/block_cipher.h"
|
||||
#endif
|
||||
|
||||
@@ -84,10 +84,10 @@ typedef struct mbedtls_ccm_context {
|
||||
#MBEDTLS_CCM_DECRYPT or
|
||||
#MBEDTLS_CCM_STAR_ENCRYPT or
|
||||
#MBEDTLS_CCM_STAR_DECRYPT. */
|
||||
#if defined(MBEDTLS_CIPHER_C)
|
||||
mbedtls_cipher_context_t MBEDTLS_PRIVATE(cipher_ctx); /*!< The cipher context used. */
|
||||
#else
|
||||
#if defined(MBEDTLS_BLOCK_CIPHER_C)
|
||||
mbedtls_block_cipher_context_t MBEDTLS_PRIVATE(block_cipher_ctx); /*!< The cipher context used. */
|
||||
#else
|
||||
mbedtls_cipher_context_t MBEDTLS_PRIVATE(cipher_ctx); /*!< The cipher context used. */
|
||||
#endif
|
||||
int MBEDTLS_PRIVATE(state); /*!< Working value holding context's
|
||||
state. Used for chunked data input */
|
||||
|
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "mbedtls/cipher.h"
|
||||
|
||||
#if !defined(MBEDTLS_CIPHER_C)
|
||||
#if defined(MBEDTLS_BLOCK_CIPHER_C)
|
||||
#include "mbedtls/block_cipher.h"
|
||||
#endif
|
||||
|
||||
@@ -50,10 +50,10 @@ extern "C" {
|
||||
* \brief The GCM context structure.
|
||||
*/
|
||||
typedef struct mbedtls_gcm_context {
|
||||
#if defined(MBEDTLS_CIPHER_C)
|
||||
mbedtls_cipher_context_t MBEDTLS_PRIVATE(cipher_ctx); /*!< The cipher context used. */
|
||||
#else
|
||||
#if defined(MBEDTLS_BLOCK_CIPHER_C)
|
||||
mbedtls_block_cipher_context_t MBEDTLS_PRIVATE(block_cipher_ctx); /*!< The cipher context used. */
|
||||
#else
|
||||
mbedtls_cipher_context_t MBEDTLS_PRIVATE(cipher_ctx); /*!< The cipher context used. */
|
||||
#endif
|
||||
uint64_t MBEDTLS_PRIVATE(HL)[16]; /*!< Precalculated HTable low. */
|
||||
uint64_t MBEDTLS_PRIVATE(HH)[16]; /*!< Precalculated HTable high. */
|
||||
|
Reference in New Issue
Block a user