mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-11 09:40:38 +00:00
Remove MBEDTLS_CMAC_ALT
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
This commit is contained in:
parent
027535c8a5
commit
efc65e1168
@ -350,7 +350,6 @@
|
|||||||
*/
|
*/
|
||||||
//#define MBEDTLS_TIMING_ALT
|
//#define MBEDTLS_TIMING_ALT
|
||||||
|
|
||||||
//#define MBEDTLS_CMAC_ALT
|
|
||||||
//#define MBEDTLS_MD5_ALT
|
//#define MBEDTLS_MD5_ALT
|
||||||
//#define MBEDTLS_SHA512_ALT
|
//#define MBEDTLS_SHA512_ALT
|
||||||
|
|
||||||
@ -2487,10 +2486,10 @@
|
|||||||
* Enable the CMAC (Cipher-based Message Authentication Code) mode for block
|
* Enable the CMAC (Cipher-based Message Authentication Code) mode for block
|
||||||
* ciphers.
|
* ciphers.
|
||||||
*
|
*
|
||||||
* \note When #MBEDTLS_CMAC_ALT is active, meaning that the underlying
|
* \note When the underlying implementation of the CMAC algorithm is provided
|
||||||
* implementation of the CMAC algorithm is provided by an alternate
|
* by an alternate implementation, that alternate implementation may opt
|
||||||
* implementation, that alternate implementation may opt to not support
|
* to not support AES-192 or 3DES as underlying block ciphers for the CMAC
|
||||||
* AES-192 or 3DES as underlying block ciphers for the CMAC operation.
|
* operation.
|
||||||
*
|
*
|
||||||
* Module: library/cmac.c
|
* Module: library/cmac.c
|
||||||
*
|
*
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
/* cmac_alt.h with dummy types for MBEDTLS_CMAC_ALT */
|
|
||||||
/*
|
|
||||||
* Copyright The Mbed TLS Contributors
|
|
||||||
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CMAC_ALT_H
|
|
||||||
#define CMAC_ALT_H
|
|
||||||
|
|
||||||
struct mbedtls_cmac_context_t {
|
|
||||||
int dummy;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* cmac_alt.h */
|
|
@ -51,8 +51,6 @@ extern "C" {
|
|||||||
#define MBEDTLS_CIPHER_BLKSIZE_MAX MBEDTLS_MAX_BLOCK_LENGTH
|
#define MBEDTLS_CIPHER_BLKSIZE_MAX MBEDTLS_MAX_BLOCK_LENGTH
|
||||||
#endif /* MBEDTLS_DEPRECATED_REMOVED */
|
#endif /* MBEDTLS_DEPRECATED_REMOVED */
|
||||||
|
|
||||||
#if !defined(MBEDTLS_CMAC_ALT)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The CMAC context structure.
|
* The CMAC context structure.
|
||||||
*/
|
*/
|
||||||
@ -68,10 +66,6 @@ struct mbedtls_cmac_context_t {
|
|||||||
size_t MBEDTLS_PRIVATE(unprocessed_len);
|
size_t MBEDTLS_PRIVATE(unprocessed_len);
|
||||||
};
|
};
|
||||||
|
|
||||||
#else /* !MBEDTLS_CMAC_ALT */
|
|
||||||
#include "cmac_alt.h"
|
|
||||||
#endif /* !MBEDTLS_CMAC_ALT */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief This function starts a new CMAC computation
|
* \brief This function starts a new CMAC computation
|
||||||
* by setting the CMAC key, and preparing to authenticate
|
* by setting the CMAC key, and preparing to authenticate
|
||||||
@ -86,7 +80,7 @@ struct mbedtls_cmac_context_t {
|
|||||||
* CMAC computation, use mbedtls_cipher_cmac_finish().
|
* CMAC computation, use mbedtls_cipher_cmac_finish().
|
||||||
*
|
*
|
||||||
* \note When the CMAC implementation is supplied by an alternate
|
* \note When the CMAC implementation is supplied by an alternate
|
||||||
* implementation (through #MBEDTLS_CMAC_ALT), some ciphers
|
* implementation (through a PSA driver), some ciphers
|
||||||
* may not be supported by that implementation, and thus
|
* may not be supported by that implementation, and thus
|
||||||
* return an error. Alternate implementations must support
|
* return an error. Alternate implementations must support
|
||||||
* AES-128 and AES-256, and may support AES-192 and 3DES.
|
* AES-128 and AES-256, and may support AES-192 and 3DES.
|
||||||
@ -178,7 +172,7 @@ int mbedtls_cipher_cmac_reset(mbedtls_cipher_context_t *ctx);
|
|||||||
* output = generic CMAC(cmac key, input buffer).
|
* output = generic CMAC(cmac key, input buffer).
|
||||||
*
|
*
|
||||||
* \note When the CMAC implementation is supplied by an alternate
|
* \note When the CMAC implementation is supplied by an alternate
|
||||||
* implementation (through #MBEDTLS_CMAC_ALT), some ciphers
|
* implementation (through a PSA driver), some ciphers
|
||||||
* may not be supported by that implementation, and thus
|
* may not be supported by that implementation, and thus
|
||||||
* return an error. Alternate implementations must support
|
* return an error. Alternate implementations must support
|
||||||
* AES-128 and AES-256, and may support AES-192 and 3DES.
|
* AES-128 and AES-256, and may support AES-192 and 3DES.
|
||||||
@ -227,7 +221,7 @@ int mbedtls_aes_cmac_prf_128(const unsigned char *key, size_t key_len,
|
|||||||
* \brief The CMAC checkup routine.
|
* \brief The CMAC checkup routine.
|
||||||
*
|
*
|
||||||
* \note In case the CMAC routines are provided by an alternative
|
* \note In case the CMAC routines are provided by an alternative
|
||||||
* implementation (i.e. #MBEDTLS_CMAC_ALT is defined), the
|
* implementation (i.e. through a PSA driver), the
|
||||||
* checkup routine will succeed even if the implementation does
|
* checkup routine will succeed even if the implementation does
|
||||||
* not support the less widely used AES-192 or 3DES primitives.
|
* not support the less widely used AES-192 or 3DES primitives.
|
||||||
* The self-test requires at least AES-128 and AES-256 to be
|
* The self-test requires at least AES-128 and AES-256 to be
|
||||||
|
@ -38,8 +38,6 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#if !defined(MBEDTLS_CMAC_ALT) || defined(MBEDTLS_SELF_TEST)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Multiplication by u in the Galois field of GF(2^n)
|
* Multiplication by u in the Galois field of GF(2^n)
|
||||||
*
|
*
|
||||||
@ -125,9 +123,6 @@ exit:
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* !defined(MBEDTLS_CMAC_ALT) || defined(MBEDTLS_SELF_TEST) */
|
|
||||||
|
|
||||||
#if !defined(MBEDTLS_CMAC_ALT)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create padded last block from (partial) last block.
|
* Create padded last block from (partial) last block.
|
||||||
@ -427,8 +422,6 @@ exit:
|
|||||||
}
|
}
|
||||||
#endif /* MBEDTLS_AES_C */
|
#endif /* MBEDTLS_AES_C */
|
||||||
|
|
||||||
#endif /* !MBEDTLS_CMAC_ALT */
|
|
||||||
|
|
||||||
#if defined(MBEDTLS_SELF_TEST)
|
#if defined(MBEDTLS_SELF_TEST)
|
||||||
/*
|
/*
|
||||||
* CMAC test data for SP800-38B
|
* CMAC test data for SP800-38B
|
||||||
|
Loading…
x
Reference in New Issue
Block a user