Topic: ecc_mulmod Speedup

I'm using ARM Cortex-M0 processor and find that it takes 4s to process ecc_mulmod. Is there any means to speed up calculation process?

Thanks

Share

Re: ecc_mulmod Speedup

Hi Patrick,

Can you confirm which API you are calling? Is it `wc_ecc_mulmod`? What ECC curve are you using?

If its one of the wc_ecc_mulmod and its one of the standard NIST prime curves like SECP256R1 then you can enable the Single Precision math speedups for Cortex M0 in sp_armthumb.c by defining the following build options:

WOLFSSL_HAVE_SP_ECC
WOLFSSL_SP_ARM_THUMB_ASM
WOLFSSL_SP_SMALL
WOLFSSL_SP_NO_MALLOC (optional)

This should provide a very significant speedup.

Thanks,
David Garske, wolfSSL

Share

Re: ecc_mulmod Speedup

Hi David,

Thanks for prompt reply.

After enabled those options, we come out compile error in sp_cortexm.c (__asm__ __volatile__). Notice this had been reported before in https://github.com/wolfSSL/wolfssl/issues/4004. I'm using Keil 5, version as attached, and facing the same issue.

I'm using WolfSSL Release 4.5.0. Not sure any update may help solving this issue. At the same time, trying to upgrade Keil to see any help.

Thanks

Share

Re: ecc_mulmod Speedup

Hi Patrick,

Yes that is a known issue and already fixed. You would need to update your wolfSSL. The latest is v5.6.6. You might be able to just pull over sp_cortexm.c if you are opposed to a full update.

Thanks,
David Garske, wolfSSL

Share