Cast LMS allocation sizes to size_t
To prevent implict casting errors on 64-bit platforms
@@ -562,7 +562,7 @@ int mbedtls_lms_generate_private_key( mbedtls_lms_private_t *ctx,
ctx->params.I_key_identifier,
MBEDTLS_LMOTS_I_KEY_ID_LEN );
- ctx->ots_private_keys = mbedtls_calloc( MERKLE_TREE_LEAF_NODE_AM(ctx->params.type),
+ ctx->ots_private_keys = mbedtls_calloc( ( size_t )MERKLE_TREE_LEAF_NODE_AM(ctx->params.type),
sizeof( mbedtls_lmots_private_t ) );
if( ctx->ots_private_keys == NULL )
{
@@ -570,7 +570,7 @@ int mbedtls_lms_generate_private_key( mbedtls_lms_private_t *ctx,
goto exit;
}
- ctx->ots_public_keys = mbedtls_calloc( MERKLE_TREE_LEAF_NODE_AM(ctx->params.type),
+ ctx->ots_public_keys = mbedtls_calloc( ( size_t )MERKLE_TREE_LEAF_NODE_AM(ctx->params.type),
sizeof( mbedtls_lmots_public_t ) );
if( ctx->ots_public_keys == NULL )
{
