Mbed TLS is now part of TrustedFirmware.org.

Bignum APIs taken longer time to get executed on Nuvoton platform


Jan 23, 2018 12:35
Nirav Agrawal

Hello Sir,

I am using Nuvoton "NUC472JI8AE" board. I have integrated mbedTLS code to use cryptographic primitives for my application. while running this application, i come to know that some specific APIs in mbed TLS library is taking longer execution time around 5 seconds.

Issue is

mbedtls_rsa_check_privkey function is taking time while key parsing. This API internally invokes below API which takes longer time to get executed.

mbedtls_mpi_gcd = 1 Sec apx.

mbedtls_mpi_inv_mod = 6 Sec apx

By observing code, we come to know that these API does some extensive arithmatic operations because of which MCU might requires longer time.

We also ensures that nuvoton platform supports hard FPU + architecture is 32bit.

In other platform, lets say on ESP32, this API works fine without any execution delay.

Please let us know if you have came across this issue before or you can provide us possible causes of this issue would be appreciated

Ask us if you require any more inputs..

 
Jan 24, 2018 15:42
Ron Eldor

Hi Nirav,
As you mentioned, these functions require extensive arithmetic operations, which consume much MCO power. unfortiunately, these operations are needed.
According to the NUC472JI8AE datasheet the core has:

Max frequency of 84 MHz

And according to the ESP32 datasheet, the CPU contain at least one MCU which has:

the clock frequency of up to 240 MHz

This explains why on the ESP32 platform, you don't see delay, compared to your Nuvoton board.
Regards,
Mbed TLS Team member
Ron