Simplify bitlen handling in psa_crypto_rsa.c #8780
Labels
component-crypto
Crypto primitives and low-level interfaces
enhancement
size-xs
Estimated task size: extra small (a few hours at most)
There is some waffling in
psa_crypto_rsa.c
around the length of RSA keys because historically there was poor support for non-byte-aligned keys:mbedtls_pk_get_bitlen
gave the wrong result and there was nombedtls_rsa_get_bitlen
, onlymbedtls_rsa_get_len
. Since #8779 this can be cleaned up.Prerequisites: #8779 (+ backport), #8740 (which touches the same code).
Goal: update obsolete comments and simplify the code if doable (avoid going back and forth between bits and bytes). Applies to 2.28 as well.
Note that PSA does not accept non-byte-aligned RSA keys. This would be a separate feature. There may be other parts of the code to fix and we'd need tests.
The text was updated successfully, but these errors were encountered: