atsign-foundation / at_c

Experimental cross-platform C implementation of the atSDK for SOC & embedded devices
BSD 3-Clause "New" or "Revised" License
2 stars 4 forks source link

at_c: rsa one singular mbedtls_rsa_context #14

Open JeremyTubongbanua opened 1 year ago

JeremyTubongbanua commented 1 year ago

In all RSA functions, we always create a new mbedtls_rsa_context which holds things like the public keys and private keys to do various operations.

For optimization, we should have one singular mbedtls_rsa_context once the public key and private key have been imported.

JeremyTubongbanua commented 11 months ago

I believe a fresh RSA context should be used each time to not reuse old RNG contexts..

Will have to investigate more on this.

JeremyTubongbanua commented 8 months ago

This is an optimization. Until we are comfortable with functionality and can move on to "nice have optimizations", this will be back logged.

JeremyTubongbanua commented 7 months ago

Discussion:

@JeremyTubongbanua - Maybe importing N E D P Q every time is costly for every RSA operation.

@XavierChanth @realvarx - think it is not costly, we will investigate later

XavierChanth commented 7 months ago

Not that it's not costly, but that there are many ways to optimize this, so we should avoid over-optimizing early.