1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Use spec values as-is for test data

Spec values are now always used for test data, and conversion to
internal representation is done in the test function.

Signed-off-by: Werner Lewis <werner.lewis@arm.com>
This commit is contained in:
Werner Lewis
2022-08-25 10:29:19 +01:00
parent e54046c9c2
commit c4afef7f46
2 changed files with 9 additions and 2 deletions

View File

@ -825,6 +825,13 @@ void mbedtls_ecp_group_metadata( int id, int bit_size, int crv_type,
TEST_EQUAL( mbedtls_test_read_mpi( &exp_B, B ), 0 );
TEST_EQUAL( mbedtls_test_read_mpi( &exp_G_y, G_y ), 0 );
// Convert exp_A to internal representation (A+2)/4
if( crv_type == MBEDTLS_ECP_TYPE_MONTGOMERY )
{
TEST_EQUAL( mbedtls_mpi_add_int( &exp_A, &exp_A, 2 ), 0 );
TEST_EQUAL( mbedtls_mpi_div_int( &exp_A, NULL, &exp_A, 4 ), 0 );
}
// Load group
TEST_EQUAL( mbedtls_ecp_group_load( &grp, id ), 0 );