Skip to content

Commit 96a4be9

Browse files
authored
Merge pull request #6177 from AndrzejKurek/ecdsa-no-md
Adjust hash dependencies in `test_suite_ecdsa`
2 parents a7448bf + 1af61cb commit 96a4be9

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/suites/test_suite_ecdsa.function

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
/* BEGIN_HEADER */
22
#include "mbedtls/ecdsa.h"
3+
#include "legacy_or_psa.h"
4+
#if ( defined(MBEDTLS_ECDSA_DETERMINISTIC) && defined(MBEDTLS_SHA256_C) ) || \
5+
( !defined(MBEDTLS_ECDSA_DETERMINISTIC) && defined(MBEDTLS_HAS_ALG_SHA_256_VIA_LOWLEVEL_OR_PSA) )
6+
#define MBEDTLS_HAS_ALG_SHA_256_VIA_MD_IF_DETERMINISTIC
7+
#endif
8+
#define MBEDTLS_TEST_HASH_MAX_SIZE 64
39
/* END_HEADER */
410

511
/* BEGIN_DEPENDENCIES
@@ -14,7 +20,7 @@ void ecdsa_prim_zero( int id )
1420
mbedtls_ecp_point Q;
1521
mbedtls_mpi d, r, s;
1622
mbedtls_test_rnd_pseudo_info rnd_info;
17-
unsigned char buf[MBEDTLS_MD_MAX_SIZE];
23+
unsigned char buf[MBEDTLS_TEST_HASH_MAX_SIZE];
1824

1925
mbedtls_ecp_group_init( &grp );
2026
mbedtls_ecp_point_init( &Q );
@@ -46,7 +52,7 @@ void ecdsa_prim_random( int id )
4652
mbedtls_ecp_point Q;
4753
mbedtls_mpi d, r, s;
4854
mbedtls_test_rnd_pseudo_info rnd_info;
49-
unsigned char buf[MBEDTLS_MD_MAX_SIZE];
55+
unsigned char buf[MBEDTLS_TEST_HASH_MAX_SIZE];
5056

5157
mbedtls_ecp_group_init( &grp );
5258
mbedtls_ecp_point_init( &Q );
@@ -224,7 +230,7 @@ exit:
224230
}
225231
/* END_CASE */
226232

227-
/* BEGIN_CASE depends_on:MBEDTLS_SHA256_C */
233+
/* BEGIN_CASE depends_on:MBEDTLS_HAS_ALG_SHA_256_VIA_MD_IF_DETERMINISTIC */
228234
void ecdsa_write_read_zero( int id )
229235
{
230236
mbedtls_ecdsa_context ctx;
@@ -284,7 +290,7 @@ exit:
284290
}
285291
/* END_CASE */
286292

287-
/* BEGIN_CASE depends_on:MBEDTLS_SHA256_C */
293+
/* BEGIN_CASE depends_on:MBEDTLS_HAS_ALG_SHA_256_VIA_MD_IF_DETERMINISTIC */
288294
void ecdsa_write_read_random( int id )
289295
{
290296
mbedtls_ecdsa_context ctx;

0 commit comments

Comments
 (0)