commit | 2f8f06aa25e9d5ee4fc9fe217543c872b39e4d05 | [log] [tgz] |
---|---|---|
author | Hanno Becker <hanno.becker@arm.com> | Fri Sep 29 11:47:26 2017 +0100 |
committer | Hanno Becker <hanno.becker@arm.com> | Fri Sep 29 11:54:05 2017 +0100 |
tree | 90064d015411a77be7b9317a0684b48498554555 | |
parent | 54cfc585cd9efc0b260c17317925f81e3a9ada6d [diff] |
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`.
diff --git a/library/rsa.c b/library/rsa.c index 4ee9308..8623011 100644 --- a/library/rsa.c +++ b/library/rsa.c
@@ -923,7 +923,7 @@ size_t mbedtls_rsa_get_len( const mbedtls_rsa_context *ctx ) { - return( mbedtls_mpi_size( &ctx->N ) ); + return( ctx->len ); }