1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

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>
This commit is contained in:
kXuan
2021-04-08 14:32:06 +08:00
parent 6d84e917bb
commit ba9cb76e9f
4 changed files with 4035 additions and 27 deletions

View File

@ -251,7 +251,11 @@ static int myrand( void *rng_state, unsigned char *output, size_t len )
#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++ )