Don't always recompute context length in mbedtls_rsa_get_len
This commit changes the implementation of `mbedtls_rsa_get_len` to return
`ctx->len` instead of always re-computing the modulus' byte-size via
`mbedtls_mpi_size`.
@@ -923,7 +923,7 @@ void mbedtls_rsa_set_padding( mbedtls_rsa_context *ctx, int padding, int hash_id
size_t mbedtls_rsa_get_len( const mbedtls_rsa_context *ctx )
{
- return( mbedtls_mpi_size( &ctx->N ) );
+ return( ctx->len );
}
