Remove MBEDTLS_CMAC_ALT
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
diff --git a/include/mbedtls/mbedtls_config.h b/include/mbedtls/mbedtls_config.h
index 5b972a9..57dab3f 100644
--- a/include/mbedtls/mbedtls_config.h
+++ b/include/mbedtls/mbedtls_config.h
@@ -350,7 +350,6 @@
*/
//#define MBEDTLS_TIMING_ALT
-//#define MBEDTLS_CMAC_ALT
//#define MBEDTLS_MD5_ALT
//#define MBEDTLS_SHA512_ALT
@@ -2487,10 +2486,10 @@
* Enable the CMAC (Cipher-based Message Authentication Code) mode for block
* ciphers.
*
- * \note When #MBEDTLS_CMAC_ALT is active, meaning that the underlying
- * implementation of the CMAC algorithm is provided by an alternate
- * implementation, that alternate implementation may opt to not support
- * AES-192 or 3DES as underlying block ciphers for the CMAC operation.
+ * \note When the underlying implementation of the CMAC algorithm is provided
+ * by an alternate implementation, that alternate implementation may opt
+ * to not support AES-192 or 3DES as underlying block ciphers for the CMAC
+ * operation.
*
* Module: library/cmac.c
*
diff --git a/tests/include/alt-dummy/cmac_alt.h b/tests/include/alt-dummy/cmac_alt.h
deleted file mode 100644
index 68b53d7..0000000
--- a/tests/include/alt-dummy/cmac_alt.h
+++ /dev/null
@@ -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 */
diff --git a/tf-psa-crypto/drivers/builtin/include/mbedtls/cmac.h b/tf-psa-crypto/drivers/builtin/include/mbedtls/cmac.h
index 97b86fc..0fa08e4 100644
--- a/tf-psa-crypto/drivers/builtin/include/mbedtls/cmac.h
+++ b/tf-psa-crypto/drivers/builtin/include/mbedtls/cmac.h
@@ -51,8 +51,6 @@
#define MBEDTLS_CIPHER_BLKSIZE_MAX MBEDTLS_MAX_BLOCK_LENGTH
#endif /* MBEDTLS_DEPRECATED_REMOVED */
-#if !defined(MBEDTLS_CMAC_ALT)
-
/**
* The CMAC context structure.
*/
@@ -68,10 +66,6 @@
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
* by setting the CMAC key, and preparing to authenticate
@@ -86,7 +80,7 @@
* CMAC computation, use mbedtls_cipher_cmac_finish().
*
* \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
* return an error. Alternate implementations must support
* AES-128 and AES-256, and may support AES-192 and 3DES.
@@ -178,7 +172,7 @@
* output = generic CMAC(cmac key, input buffer).
*
* \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
* return an error. Alternate implementations must support
* AES-128 and AES-256, and may support AES-192 and 3DES.
@@ -227,7 +221,7 @@
* \brief The CMAC checkup routine.
*
* \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
* not support the less widely used AES-192 or 3DES primitives.
* The self-test requires at least AES-128 and AES-256 to be
diff --git a/tf-psa-crypto/drivers/builtin/src/cmac.c b/tf-psa-crypto/drivers/builtin/src/cmac.c
index eda10d0..5e517c4 100644
--- a/tf-psa-crypto/drivers/builtin/src/cmac.c
+++ b/tf-psa-crypto/drivers/builtin/src/cmac.c
@@ -38,8 +38,6 @@
#include <string.h>
-#if !defined(MBEDTLS_CMAC_ALT) || defined(MBEDTLS_SELF_TEST)
-
/*
* Multiplication by u in the Galois field of GF(2^n)
*
@@ -125,9 +123,6 @@
return ret;
}
-#endif /* !defined(MBEDTLS_CMAC_ALT) || defined(MBEDTLS_SELF_TEST) */
-
-#if !defined(MBEDTLS_CMAC_ALT)
/*
* Create padded last block from (partial) last block.
@@ -427,8 +422,6 @@
}
#endif /* MBEDTLS_AES_C */
-#endif /* !MBEDTLS_CMAC_ALT */
-
#if defined(MBEDTLS_SELF_TEST)
/*
* CMAC test data for SP800-38B