mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-07 06:42:56 +03:00
Fix iterator types in LMOTS
Signed-off-by: Raef Coles <raef.coles@arm.com>
This commit is contained in:
@@ -182,13 +182,10 @@ static int hash_digit_array( const mbedtls_lmots_parameters_t *params,
|
|||||||
const unsigned char *hash_idx_max_values,
|
const unsigned char *hash_idx_max_values,
|
||||||
unsigned char *output )
|
unsigned char *output )
|
||||||
{
|
{
|
||||||
unsigned char i_digit_idx;
|
unsigned int i_digit_idx;
|
||||||
unsigned char j_hash_idx;
|
|
||||||
unsigned char i_digit_idx_bytes[I_DIGIT_IDX_LEN];
|
unsigned char i_digit_idx_bytes[I_DIGIT_IDX_LEN];
|
||||||
unsigned char j_hash_idx_bytes[1];
|
unsigned int j_hash_idx;
|
||||||
/* These can't be unsigned chars, because they are sometimes set to
|
unsigned char j_hash_idx_bytes[J_HASH_IDX_LEN];
|
||||||
* #DIGIT_MAX_VALUE, which has a value of 256
|
|
||||||
*/
|
|
||||||
unsigned int j_hash_idx_min;
|
unsigned int j_hash_idx_min;
|
||||||
unsigned int j_hash_idx_max;
|
unsigned int j_hash_idx_max;
|
||||||
psa_hash_operation_t op;
|
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 ?
|
j_hash_idx_max = hash_idx_max_values != NULL ?
|
||||||
hash_idx_max_values[i_digit_idx] : DIGIT_MAX_VALUE;
|
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 < j_hash_idx_max;
|
||||||
j_hash_idx++ )
|
j_hash_idx++ )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user