Fix iterator types in LMOTS

Signed-off-by: Raef Coles <raef.coles@arm.com>
This commit is contained in:
Raef Coles 2022-09-02 17:13:01 +01:00
parent f5919e2997
commit 8738a49d0c
No known key found for this signature in database
GPG Key ID: 1AAF1B43DF2086F4

View File

@ -182,13 +182,10 @@ static int hash_digit_array( const mbedtls_lmots_parameters_t *params,
const unsigned char *hash_idx_max_values,
unsigned char *output )
{
unsigned char i_digit_idx;
unsigned char j_hash_idx;
unsigned int i_digit_idx;
unsigned char i_digit_idx_bytes[I_DIGIT_IDX_LEN];
unsigned char j_hash_idx_bytes[1];
/* These can't be unsigned chars, because they are sometimes set to
* #DIGIT_MAX_VALUE, which has a value of 256
*/
unsigned int j_hash_idx;
unsigned char j_hash_idx_bytes[J_HASH_IDX_LEN];
unsigned int j_hash_idx_min;
unsigned int j_hash_idx_max;
psa_hash_operation_t op;
@ -213,7 +210,7 @@ static int hash_digit_array( const mbedtls_lmots_parameters_t *params,
j_hash_idx_max = hash_idx_max_values != NULL ?
hash_idx_max_values[i_digit_idx] : DIGIT_MAX_VALUE;
for ( j_hash_idx = ( unsigned char )j_hash_idx_min;
for ( j_hash_idx = j_hash_idx_min;
j_hash_idx < j_hash_idx_max;
j_hash_idx++ )
{