Hi Kareem,

Thanks for the reply,

Your suggestion: "For the best speed with ECC, I would recommend using SP math with SP math assembly speedups" did help to reduce the latency to 3 seconds. Although WOLFSSL_SP_ARM_CORTEX_M_ASM did give me few errors, so skipped that. Can you help me any other ways, I can still fasten this.

I tried attaching the config settings file. It doesn't add for some reason.

What is the size of the key you are trying to verify: It's 256 bit.

I don't know how to find out the version because the library was ported form the IDE environment. Let me check that with Microchip.

Hi,

I'm trying to bring wolfssl onto the microchip platform - MPLAB IDE. The current problem is with the ECDSA signature verification.

Environment details:
IDE - MPLAB IDE
MCU - SAME51
wolfssl library - Imported through the MPLAB code configurator [mcc]

I'm using the wc_ecc_verify_hash API for the verification. The verification is successful, but it seems to be taking a lot of time. I have added some log messages at the entry of each Internal function calls just to verify where it's taking a lot of time. Here is the log with timestamp:

[2024-08-26 16:06:40.964] DecodeECC_DSA_Sig
[2024-08-26 16:06:40.964] wc_ecc_verify_hash_ex
[2024-08-26 16:06:40.964] Entering mp_init
[2024-08-26 16:06:40.965] wc_ecc_curve_load
[2024-08-26 16:06:40.971] mp_init_multi
[2024-08-26 16:06:40.971] wc_ecc_new_point_ex MG
[2024-08-26 16:06:40.977] wc_ecc_new_point_ex MQ
[2024-08-26 16:06:40.977] mp_invmod
[2024-08-26 16:06:41.085] ecc_mul2add
[2024-08-26 16:06:56.938] mp_mod
[2024-08-26 16:06:56.950] mp_cmp
[2024-08-26 16:06:56.950] mp_cmp done
[2024-08-26 16:06:56.959] wc_ecc_curve_free FREE_CURVE_SPECS DONE
[2024-08-26 16:06:56.961] ECC_STATE_VERIFY_RES
[2024-08-26 16:06:56.961] Entering wc_ecc_reset
[2024-08-26 16:06:56.966] wc_ecc_reset
[2024-08-26 16:06:56.966] verification successful

you can see that ecc_mul2add is taking at least 7 seconds


I have also attached the my configuration for the library. you can see that I have define ECC_SHAMIR as this has a different API for verification and the time was less that not using this method.
The function call under the comment:
/* use Shamir's trick to compute u1*mG + u2*mQ using half the doubles */

My requirement is to finish the verification within 1 min [time sensitive]. I would like to know what can be the reason for it to take this much time and any ways to reduce the latency of it.

Any help appreciated.

Thanks.