Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove MBEDTLS_RSA_NO_CRT #114

Open
gilles-peskine-arm opened this issue Dec 5, 2024 · 0 comments
Open

Remove MBEDTLS_RSA_NO_CRT #114

gilles-peskine-arm opened this issue Dec 5, 2024 · 0 comments
Labels
enhancement New feature or request size-s Estimated task size: small (~2d)

Comments

@gilles-peskine-arm
Copy link
Contributor

MBEDTLS_RSA_NO_CRT is a compromise between features, performance and code size:

  • When enabled, the Mbed TLS 3.x rsa.h interface can import private keys without the private exponent, and can export keys with the CRT parameters.
  • When enabled, RSA private key operations are slower.
  • When enabled, the size of rsa.o is smaller.
  • I am not aware of a security impact. Enabling MBEDTLS_RSA_NO_CRT avoids a classic glitch attack on RSA signature operations that can leak the private key, but we mitigate against that attack even when MBEDTLS_RSA_NO_CRT is disabled by checking that the calculated signature passes verification.

TF-PSA-Crypto removes rsa.h from the public API. Therefore MBEDTLS_RSA_NO_CRT no longer has a direct impact on the API. Furthermore, the PSA export format includes CRT parameters, so PSA requires CRT parameters. (However, everything might just work with MBEDTLS_RSA_NO_CRT disabled, because CRT parameters are available after generating a key, and they must be present on import, so our code just needs to copy them around, it doesn't have to calculate with them.)

That leaves MBEDTLS_RSA_NO_CRT as just a performance/code-size compromise, only for RSA private-key operations. This is not very useful and I think we should just remove it from TF-PSA-Crypto 1.0.

Arguably, given that there is no functional impact, we could make the option a no-op in a minor release.

@gilles-peskine-arm gilles-peskine-arm added enhancement New feature or request size-s Estimated task size: small (~2d) labels Dec 5, 2024
@gilles-peskine-arm gilles-peskine-arm moved this to Implementation needed in Mbed TLS 4.0 planning Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size-s Estimated task size: small (~2d)
Projects
Status: Implementation needed
Development

No branches or pull requests

1 participant