mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-26 20:37:15 +00:00
mbedtls_ecp_gen_key() generates a private key and calculates the public key. Calculating the public key takes most of the CPU time. But the PSA key store doesn't store the key, in order to simplify the plumbing when drivers are involved. So the time spent calculating the public key is a waste. Instead, call mbedtls_ecp_gen_privkey(), which does not calculate the public key. This also saves 8 instructions in a sample arm thumb build. Resolves #9732. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>