Test the new deterministic ECDSA function

This commit is contained in:
Janos Follath 2019-01-16 14:32:03 +00:00
parent 2934c32da2
commit e552a826fd

View File

@ -129,6 +129,16 @@ void ecdsa_det_test_vectors( int id, char *d_str, int md_alg,
TEST_ASSERT( mbedtls_mpi_cmp_mpi( &r, &r_check ) == 0 );
TEST_ASSERT( mbedtls_mpi_cmp_mpi( &s, &s_check ) == 0 );
mbedtls_mpi_free( &r ); mbedtls_mpi_free( &s );
mbedtls_mpi_init( &r ); mbedtls_mpi_init( &s );
TEST_ASSERT(
mbedtls_ecdsa_sign_det_ext( &grp, &r, &s, &d, hash, hlen,
md_alg, rnd_std_rand, NULL )
== 0 );
TEST_ASSERT( mbedtls_mpi_cmp_mpi( &r, &r_check ) == 0 );
TEST_ASSERT( mbedtls_mpi_cmp_mpi( &s, &s_check ) == 0 );
exit:
mbedtls_ecp_group_free( &grp );
mbedtls_mpi_free( &d ); mbedtls_mpi_free( &r ); mbedtls_mpi_free( &s );