mbedtls: Namespace for TF specific macros
authorDavid Cunado <david.cunado@arm.com>
Wed, 10 May 2017 15:38:44 +0000 (16:38 +0100)
committerDavid Cunado <david.cunado@arm.com>
Fri, 12 May 2017 13:44:35 +0000 (14:44 +0100)
An earlier patch (arm-trusted-firmware#874) migrated MBEDTLS_ suffixed
macros to have a TBBR_ suffix to avoid any potential clash with future
mbedtls macros.

But on reflection the TBBR_ suffix could be confusing as the macros
are used to drive TF-specific configuration of mbedtls. As such
this patch migrates these macros from TBBR_suffix to TF_MBEDTLS_
suffix which more accurately conveys their use.

Change-Id: Ic87642b653ceeaa03d62f724976abd5e12e867d4
Signed-off-by: David Cunado <david.cunado@arm.com>
drivers/auth/mbedtls/mbedtls_common.c
drivers/auth/mbedtls/mbedtls_crypto.mk
include/drivers/auth/mbedtls/mbedtls_config.h

index c71f81ea04e785d62c27479058ecae23af6c48e0..aad49a7152ef58789eadb25371a9ee24240cf416 100644 (file)
@@ -12,9 +12,9 @@
 /*
  * mbed TLS heap
  */
-#if (TBBR_KEY_ALG_ID == TBBR_ECDSA)
+#if (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_ECDSA)
 #define MBEDTLS_HEAP_SIZE              (14*1024)
-#elif (TBBR_KEY_ALG_ID == TBBR_RSA)
+#elif (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_RSA)
 #define MBEDTLS_HEAP_SIZE              (8*1024)
 #endif
 static unsigned char heap[MBEDTLS_HEAP_SIZE];
index 578fc106e70e400205992121bbeef2669e31fbed..11df5ad36565c7d4d80a3d5d891f6ea5672bd255 100644 (file)
@@ -31,18 +31,18 @@ ifeq (${MBEDTLS_KEY_ALG},ecdsa)
                                        ecp_curves.c                            \
                                        ecp.c                                   \
                                        )
-    TBBR_KEY_ALG_ID            :=      TBBR_ECDSA
+    TF_MBEDTLS_KEY_ALG_ID      :=      TF_MBEDTLS_ECDSA
 else ifeq (${MBEDTLS_KEY_ALG},rsa)
     MBEDTLS_CRYPTO_SOURCES     +=      $(addprefix ${MBEDTLS_DIR}/library/,    \
                                        rsa.c                                   \
                                        )
-    TBBR_KEY_ALG_ID            :=      TBBR_RSA
+    TF_MBEDTLS_KEY_ALG_ID      :=      TF_MBEDTLS_RSA
 else
     $(error "MBEDTLS_KEY_ALG=${MBEDTLS_KEY_ALG} not supported on mbed TLS")
 endif
 
 # Needs to be set to drive mbed TLS configuration correctly
-$(eval $(call add_define,TBBR_KEY_ALG_ID))
+$(eval $(call add_define,TF_MBEDTLS_KEY_ALG_ID))
 
 BL1_SOURCES                    +=      ${MBEDTLS_CRYPTO_SOURCES}
 BL2_SOURCES                    +=      ${MBEDTLS_CRYPTO_SOURCES}
index edb294aba25edfde41bcf9fb101222bf12bda265..7d8d17c357b1fd90faf76c10bc80e0e1abac0650 100644 (file)
@@ -9,8 +9,8 @@
 /*
  * Key algorithms currently supported on mbed TLS libraries
  */
-#define TBBR_RSA       1
-#define TBBR_ECDSA     2
+#define TF_MBEDTLS_RSA         1
+#define TF_MBEDTLS_ECDSA       2
 
 /*
  * Configuration file to build mbed TLS with the required features for
 
 #define MBEDTLS_PLATFORM_C
 
-#if (TBBR_KEY_ALG_ID == TBBR_ECDSA)
+#if (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_ECDSA)
 #define MBEDTLS_ECDSA_C
 #define MBEDTLS_ECP_C
 #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
-#elif (TBBR_KEY_ALG_ID == TBBR_RSA)
+#elif (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_RSA)
 #define MBEDTLS_RSA_C
 #endif