feat(auth): ecdsa p384 key support
Use KEY_SIZE 384 to enable ECDSA P384 key support by
setting MBEDTLS_ECP_DP_SECP384R1_ENABLED.
Selected by setting KEY_ALG=ecdsa and KEY_SIZE=384.
Change-Id: I382f34fc4da98f166a2aada5d16fdf44632b47f5
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
diff --git a/drivers/auth/mbedtls/mbedtls_common.mk b/drivers/auth/mbedtls/mbedtls_common.mk
index 376b6b7..e380c86 100644
--- a/drivers/auth/mbedtls/mbedtls_common.mk
+++ b/drivers/auth/mbedtls/mbedtls_common.mk
@@ -107,11 +107,21 @@
ifeq (${TF_MBEDTLS_KEY_SIZE},)
ifneq ($(findstring rsa,${TF_MBEDTLS_KEY_ALG}),)
- ifeq (${KEY_SIZE},)
+ ifeq (${KEY_SIZE},)
TF_MBEDTLS_KEY_SIZE := 2048
- else
+ else ifneq ($(filter $(KEY_SIZE), 1024 2048 3072 4096),)
+ TF_MBEDTLS_KEY_SIZE := ${KEY_SIZE}
+ else
+ $(error "Invalid value for KEY_SIZE: ${KEY_SIZE}")
+ endif
+ else ifneq ($(findstring ecdsa,${TF_MBEDTLS_KEY_ALG}),)
+ ifeq (${KEY_SIZE},)
+ TF_MBEDTLS_KEY_SIZE := 256
+ else ifneq ($(filter $(KEY_SIZE), 256 384),)
TF_MBEDTLS_KEY_SIZE := ${KEY_SIZE}
- endif
+ else
+ $(error "Invalid value for KEY_SIZE: ${KEY_SIZE}")
+ endif
endif
endif