Allocate LMS C_RANDOM_VALUE as hash size

Signed-off-by: Raef Coles <raef.coles@arm.com>
This commit is contained in:
Raef Coles 2022-10-10 13:10:07 +01:00
parent 1fb2f32ef5
commit d48f7e90bb
No known key found for this signature in database
GPG Key ID: 1AAF1B43DF2086F4

View File

@ -60,9 +60,6 @@
#define J_HASH_IDX_LEN (1)
#define D_CONST_LEN (2)
/* Currently only defined for SHA256, 32 is the max hash output size */
#define C_RANDOM_VALUE_LEN_MAX (MBEDTLS_LMOTS_N_HASH_LEN_MAX)
#define DIGIT_MAX_VALUE ((1u << W_WINTERNITZ_PARAMETER) - 1u)
#define D_CONST_LEN (2)
@ -731,7 +728,7 @@ int mbedtls_lmots_sign( mbedtls_lmots_private_t *ctx,
* key.
*/
unsigned char tmp_sig[MBEDTLS_LMOTS_P_SIG_DIGIT_COUNT_MAX][MBEDTLS_LMOTS_N_HASH_LEN_MAX];
unsigned char tmp_c_random[C_RANDOM_VALUE_LEN_MAX];
unsigned char tmp_c_random[MBEDTLS_LMOTS_N_HASH_LEN_MAX];
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
if( msg == NULL && msg_size != 0 )