Use more meaningful variable name in mbedtls_rsa_rsaes_oaep_decrypt

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
Dave Rodgman 2023-09-20 19:06:02 +01:00
parent e94cd0b99b
commit c62f7fcce9

View file

@ -1542,7 +1542,7 @@ int mbedtls_rsa_rsaes_oaep_decrypt(mbedtls_rsa_context *ctx,
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
size_t ilen, i, pad_len; size_t ilen, i, pad_len;
unsigned char *p; unsigned char *p;
mbedtls_ct_condition_t bad, pad_done; mbedtls_ct_condition_t bad, in_padding;
unsigned char buf[MBEDTLS_MPI_MAX_SIZE]; unsigned char buf[MBEDTLS_MPI_MAX_SIZE];
unsigned char lhash[MBEDTLS_MD_MAX_SIZE]; unsigned char lhash[MBEDTLS_MD_MAX_SIZE];
unsigned int hlen; unsigned int hlen;
@ -1614,10 +1614,10 @@ int mbedtls_rsa_rsaes_oaep_decrypt(mbedtls_rsa_context *ctx,
/* Get zero-padding len, but always read till end of buffer /* Get zero-padding len, but always read till end of buffer
* (minus one, for the 01 byte) */ * (minus one, for the 01 byte) */
pad_len = 0; pad_len = 0;
pad_done = MBEDTLS_CT_FALSE; in_padding = MBEDTLS_CT_TRUE;
for (i = 0; i < ilen - 2 * hlen - 2; i++) { for (i = 0; i < ilen - 2 * hlen - 2; i++) {
pad_done = mbedtls_ct_bool_or(pad_done, mbedtls_ct_uint_ne(p[i], 0)); in_padding = mbedtls_ct_bool_and(in_padding, mbedtls_ct_uint_eq(p[i], 0));
pad_len += mbedtls_ct_uint_if_else_0(mbedtls_ct_bool_not(pad_done), 1); pad_len += mbedtls_ct_uint_if_else_0(in_padding, 1);
} }
p += pad_len; p += pad_len;