Topic: Raspberry Pi Pico-2W RSA not working

Hi all,

I have been trying to implement RSA on the Raspberry Pi Pico 2W RP2350 microcontroller with the Dual Cortex-M33 processor. However, I am getting stuck at wc_MakeRsaKey

RsaKey priv;
WC_RNG rng;
int ret = 0;
long e = 65537; // standard value to use for exponent

ret = wc_InitRsaKey(&priv, NULL);
printf("wc_InitRsaKey ret: %d\n", ret);
ret = wc_InitRng(&rng);
printf("wc_InitRng ret: %d\n", ret);
ret = wc_RsaSetRNG(&priv, &rng);
printf("wc_RsaSetRNG ret: %d\n", ret);
// generate 2048 bit long private key
ret = wc_MakeRsaKey(&priv, 2048, e, &rng);
printf("wc_MakeRsaKey ret: %d\n", ret);

I have tried the benchmark tests and have been unable to replicate the results at https://www.wolfssl.com/docs/benchmarks/
The platform that WolfSSL tested with is slightly different:
Raspberry Pi Pico-W
ARM Cortext M0+, 125MHz
When trying to run to run bench_main from the example repository in WolfSSL:
https://github.com/wolfSSL/wolfssl-exam … nch_main.c
The code gets stuck at RSA.


I saw a blog post here related to this issue:
https://www.wolfssl.com/forums/topic125 … stops.html

However, I am unsure if this is the issue and, if so, how to resolve it for my Pico 2W. Any help is appreciated.

Share

Re: Raspberry Pi Pico-2W RSA not working

Hi Yin,

The RSA Key Generation is extremely computational and I would expect it to take several minutes on an M0+ at 125MHz. It must find two large primes. The RSA key generation on a device like this is fairly impractical and many companies will load a pre-provisioned RSA key. What is your use-case? Can you tell us more about your project?

Thanks,
David Garske, wolfSSL

Share