static initialize comb table
MBEDTLS_ECP_FIXED_POINT_OPTIM aims to speed up ecc multiplication performance.
We compute the comb table in runtime now. It is a costly operation.
This patch add a pre-computed table to initialize well-known curves. It speed up ECDSA signature verify process in runtime by using more ROM size.
Signed-off-by: kXuan <kxuanobj@gmail.com>
diff --git a/programs/test/benchmark.c b/programs/test/benchmark.c
index 3e4ac8b..e123453 100644
--- a/programs/test/benchmark.c
+++ b/programs/test/benchmark.c
@@ -251,7 +251,11 @@
#if defined(MBEDTLS_ECP_C)
void ecp_clear_precomputed( mbedtls_ecp_group *grp )
{
- if( grp->T != NULL )
+ if( grp->T != NULL
+#if MBEDTLS_ECP_FIXED_POINT_OPTIM == 1
+ && grp->T_size != 0
+#endif
+ )
{
size_t i;
for( i = 0; i < grp->T_size; i++ )