mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-05-30 04:04:51 +03:00
Introduce a new macro for hash size in ecdsa tests
Previously these tests depended on the definition from inside the MD module, which in turn could be 32 or 64 bytes depending on whether MBEDTLS_SHA512_C was defined. This is unnecessary, so a constant is itnroduced instead. Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
parent
9f42c0683c
commit
1af61cb75b
@ -5,6 +5,7 @@
|
||||
( !defined(MBEDTLS_ECDSA_DETERMINISTIC) && defined(MBEDTLS_HAS_ALG_SHA_256_VIA_LOWLEVEL_OR_PSA) )
|
||||
#define MBEDTLS_HAS_ALG_SHA_256_VIA_MD_IF_DETERMINISTIC
|
||||
#endif
|
||||
#define MBEDTLS_TEST_HASH_MAX_SIZE 64
|
||||
/* END_HEADER */
|
||||
|
||||
/* BEGIN_DEPENDENCIES
|
||||
@ -19,7 +20,7 @@ void ecdsa_prim_zero( int id )
|
||||
mbedtls_ecp_point Q;
|
||||
mbedtls_mpi d, r, s;
|
||||
mbedtls_test_rnd_pseudo_info rnd_info;
|
||||
unsigned char buf[MBEDTLS_MD_MAX_SIZE];
|
||||
unsigned char buf[MBEDTLS_TEST_HASH_MAX_SIZE];
|
||||
|
||||
mbedtls_ecp_group_init( &grp );
|
||||
mbedtls_ecp_point_init( &Q );
|
||||
@ -51,7 +52,7 @@ void ecdsa_prim_random( int id )
|
||||
mbedtls_ecp_point Q;
|
||||
mbedtls_mpi d, r, s;
|
||||
mbedtls_test_rnd_pseudo_info rnd_info;
|
||||
unsigned char buf[MBEDTLS_MD_MAX_SIZE];
|
||||
unsigned char buf[MBEDTLS_TEST_HASH_MAX_SIZE];
|
||||
|
||||
mbedtls_ecp_group_init( &grp );
|
||||
mbedtls_ecp_point_init( &Q );
|
||||
|
Loading…
x
Reference in New Issue
Block a user