ta: switch to to mbedtls for bignum
Adds tee_api_arith_mpi.c wrapper providing the TEE Arithmetical API around
the big (mpi) routines from mbedtls.
CFG_TA_MBEDTLS_MPI=y (default y) enables the usage of the bignum routines
in libutee.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/lib/libmbedtls/include/mbedtls_config_uta.h b/lib/libmbedtls/include/mbedtls_config_uta.h
index 2f5f636..cb41122 100644
--- a/lib/libmbedtls/include/mbedtls_config_uta.h
+++ b/lib/libmbedtls/include/mbedtls_config_uta.h
@@ -3,6 +3,12 @@
#ifndef __MBEDTLS_CONFIG_UTA_H
#define __MBEDTLS_CONFIG_UTA_H
+/*
+ * When wrapping using TEE_BigInt to represent a mbedtls_mpi we can only
+ * use 32-bit arithmetics.
+ */
+#define MBEDTLS_HAVE_INT32
+
#define MBEDTLS_CIPHER_MODE_CBC
#define MBEDTLS_PKCS1_V15
@@ -20,6 +26,7 @@
#define MBEDTLS_NO_PLATFORM_ENTROPY
#define MBEDTLS_BIGNUM_C
+#define MBEDTLS_GENPRIME
#define MBEDTLS_RSA_C
#define MBEDTLS_ECDH_C
#define MBEDTLS_ECDSA_C