Hi jurkovi,
What Cortex-M4 processor are you using for your benchmarks? And what public key size are you using (1024, 2048, 4096, ...)?
Are you using the wolfCrypt benchmark application to run the benchmarks?
Thanks,
Chris
Hi Chris,
sorry for not including the specifications:
I use TM4C123GH6PMI Cortex-M4 80 Mhz.
This is the first time I am working with a microcontroller, so I might have made a mistake somewhere.
The times on web are for 120 Mhz, but these are longer times, encrypting in order of magnitude, and decrypting 4x-longer.
When I used the same commands, I got
RSA 2048 encrypting: 620 ms
RSA 2048 decrypting: 5510 ms
Commands:
1191-byte DER-key inicialized in code (copied from benchmark.c)
// RSA crypting:
int derSz = 1191;
word32 idx = 0;
byte message [] = "Everyone gets Friday off.";
const int len = (int)strlen((char*)message);
byte enc[256];
RNG rng; wc_InitRng(&rng);
wc_InitRsaKey(&rsaKey, NULL);
ret = wc_RsaPrivateKeyDecode(DERarray, &idx, &rsaKey, derSz);
word32 ciphreLen = wc_RsaPublicEncrypt(message, len, enc, sizeof(enc), &rsaKey, &rng);
// RSA decrypting:
byte out[256];
wc_RsaPrivateDecrypt(enc, ciphreLen, out, sizeof(out), &rsaKey);