From e3a062ba1f10ab837c2418ace9ea8fb4b961f4a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 11 May 2015 18:46:47 +0200 Subject: [PATCH] Rename ecp_use_known_dp -> mbedtls_ecp_group_load() --- include/mbedtls/compat-1.3.h | 2 +- include/mbedtls/ecdh.h | 2 +- include/mbedtls/ecp.h | 4 ++-- library/ecdsa.c | 2 +- library/ecp.c | 10 +++++----- library/ecp_curves.c | 2 +- library/pkparse.c | 4 ++-- library/ssl_srv.c | 4 ++-- programs/test/benchmark.c | 8 ++++---- scripts/data_files/rename-1.3-2.0.txt | 2 +- tests/suites/test_suite_ecdh.function | 6 +++--- tests/suites/test_suite_ecdsa.function | 6 +++--- tests/suites/test_suite_ecp.function | 26 +++++++++++++------------- tests/suites/test_suite_pk.function | 4 ++-- 14 files changed, 41 insertions(+), 41 deletions(-) diff --git a/include/mbedtls/compat-1.3.h b/include/mbedtls/compat-1.3.h index dd03b7129..ae3e14e2b 100644 --- a/include/mbedtls/compat-1.3.h +++ b/include/mbedtls/compat-1.3.h @@ -2003,7 +2003,7 @@ #define ecp_tls_read_point mbedtls_ecp_tls_read_point #define ecp_tls_write_group mbedtls_ecp_tls_write_group #define ecp_tls_write_point mbedtls_ecp_tls_write_point -#define ecp_use_known_dp mbedtls_ecp_use_known_dp +#define ecp_use_known_dp mbedtls_ecp_group_load #define entropy_add_source mbedtls_entropy_add_source #define entropy_context mbedtls_entropy_context #define entropy_free mbedtls_entropy_free diff --git a/include/mbedtls/ecdh.h b/include/mbedtls/ecdh.h index ca990c95d..53eb8d355 100644 --- a/include/mbedtls/ecdh.h +++ b/include/mbedtls/ecdh.h @@ -122,7 +122,7 @@ void mbedtls_ecdh_free( mbedtls_ecdh_context *ctx ); * \param p_rng RNG parameter * * \note This function assumes that ctx->grp has already been - * properly set (for example using mbedtls_ecp_use_known_dp). + * properly set (for example using mbedtls_ecp_group_load). * * \return 0 if successful, or an MBEDTLS_ERR_ECP_XXX error code */ diff --git a/include/mbedtls/ecp.h b/include/mbedtls/ecp.h index 224e13579..569c581dc 100644 --- a/include/mbedtls/ecp.h +++ b/include/mbedtls/ecp.h @@ -49,7 +49,7 @@ extern "C" { * * \warning This library does not support validation of arbitrary domain * parameters. Therefore, only well-known domain parameters from trusted - * sources should be used. See mbedtls_ecp_use_known_dp(). + * sources should be used. See mbedtls_ecp_group_load(). */ typedef enum { @@ -450,7 +450,7 @@ int mbedtls_ecp_tls_write_point( const mbedtls_ecp_group *grp, const mbedtls_ecp * \note Index should be a value of RFC 4492's enum NamedCurve, * usually in the form of a MBEDTLS_ECP_DP_XXX macro. */ -int mbedtls_ecp_use_known_dp( mbedtls_ecp_group *grp, mbedtls_ecp_group_id index ); +int mbedtls_ecp_group_load( mbedtls_ecp_group *grp, mbedtls_ecp_group_id index ); /** * \brief Set a group from a TLS ECParameters record diff --git a/library/ecdsa.c b/library/ecdsa.c index babc588ac..df8122e00 100644 --- a/library/ecdsa.c +++ b/library/ecdsa.c @@ -409,7 +409,7 @@ cleanup: int mbedtls_ecdsa_genkey( mbedtls_ecdsa_context *ctx, mbedtls_ecp_group_id gid, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ) { - return( mbedtls_ecp_use_known_dp( &ctx->grp, gid ) || + return( mbedtls_ecp_group_load( &ctx->grp, gid ) || mbedtls_ecp_gen_keypair( &ctx->grp, &ctx->d, &ctx->Q, f_rng, p_rng ) ); } diff --git a/library/ecp.c b/library/ecp.c index 52cedd383..dcb04ab36 100644 --- a/library/ecp.c +++ b/library/ecp.c @@ -387,7 +387,7 @@ cleanup: */ int mbedtls_ecp_group_copy( mbedtls_ecp_group *dst, const mbedtls_ecp_group *src ) { - return mbedtls_ecp_use_known_dp( dst, src->id ); + return mbedtls_ecp_group_load( dst, src->id ); } /* @@ -613,7 +613,7 @@ int mbedtls_ecp_tls_read_group( mbedtls_ecp_group *grp, const unsigned char **bu if( ( curve_info = mbedtls_ecp_curve_info_from_tls_id( tls_id ) ) == NULL ) return( MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE ); - return mbedtls_ecp_use_known_dp( grp, curve_info->grp_id ); + return mbedtls_ecp_group_load( grp, curve_info->grp_id ); } /* @@ -1846,7 +1846,7 @@ int mbedtls_ecp_gen_key( mbedtls_ecp_group_id grp_id, mbedtls_ecp_keypair *key, { int ret; - if( ( ret = mbedtls_ecp_use_known_dp( &key->grp, grp_id ) ) != 0 ) + if( ( ret = mbedtls_ecp_group_load( &key->grp, grp_id ) ) != 0 ) return( ret ); return( mbedtls_ecp_gen_keypair( &key->grp, &key->d, &key->Q, f_rng, p_rng ) ); @@ -1925,9 +1925,9 @@ int mbedtls_ecp_self_test( int verbose ) /* Use secp192r1 if available, or any available curve */ #if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) - MBEDTLS_MPI_CHK( mbedtls_ecp_use_known_dp( &grp, MBEDTLS_ECP_DP_SECP192R1 ) ); + MBEDTLS_MPI_CHK( mbedtls_ecp_group_load( &grp, MBEDTLS_ECP_DP_SECP192R1 ) ); #else - MBEDTLS_MPI_CHK( mbedtls_ecp_use_known_dp( &grp, mbedtls_ecp_curve_list()->grp_id ) ); + MBEDTLS_MPI_CHK( mbedtls_ecp_group_load( &grp, mbedtls_ecp_curve_list()->grp_id ) ); #endif if( verbose != 0 ) diff --git a/library/ecp_curves.c b/library/ecp_curves.c index 9a477e191..41d7f79b9 100644 --- a/library/ecp_curves.c +++ b/library/ecp_curves.c @@ -692,7 +692,7 @@ cleanup: /* * Set a group using well-known domain parameters */ -int mbedtls_ecp_use_known_dp( mbedtls_ecp_group *grp, mbedtls_ecp_group_id id ) +int mbedtls_ecp_group_load( mbedtls_ecp_group *grp, mbedtls_ecp_group_id id ) { mbedtls_ecp_group_free( grp ); diff --git a/library/pkparse.c b/library/pkparse.c index 32974d18f..f5a985322 100644 --- a/library/pkparse.c +++ b/library/pkparse.c @@ -373,7 +373,7 @@ static int pk_group_id_from_group( const mbedtls_ecp_group *grp, mbedtls_ecp_gro { /* Load the group associated to that id */ mbedtls_ecp_group_free( &ref ); - MBEDTLS_MPI_CHK( mbedtls_ecp_use_known_dp( &ref, *id ) ); + MBEDTLS_MPI_CHK( mbedtls_ecp_group_load( &ref, *id ) ); /* Compare to the group we were given, starting with easy tests */ if( grp->pbits == ref.pbits && grp->nbits == ref.nbits && @@ -459,7 +459,7 @@ static int pk_use_ecparams( const mbedtls_asn1_buf *params, mbedtls_ecp_group *g if( grp->id != MBEDTLS_ECP_DP_NONE && grp->id != grp_id ) return( MBEDTLS_ERR_PK_KEY_INVALID_FORMAT ); - if( ( ret = mbedtls_ecp_use_known_dp( grp, grp_id ) ) != 0 ) + if( ( ret = mbedtls_ecp_group_load( grp, grp_id ) ) != 0 ) return( ret ); return( 0 ); diff --git a/library/ssl_srv.c b/library/ssl_srv.c index b442e653e..7d22b4845 100644 --- a/library/ssl_srv.c +++ b/library/ssl_srv.c @@ -2938,10 +2938,10 @@ curve_matching_done: MBEDTLS_SSL_DEBUG_MSG( 2, ( "ECDHE curve: %s", (*curve)->name ) ); - if( ( ret = mbedtls_ecp_use_known_dp( &ssl->handshake->ecdh_ctx.grp, + if( ( ret = mbedtls_ecp_group_load( &ssl->handshake->ecdh_ctx.grp, (*curve)->grp_id ) ) != 0 ) { - MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ecp_use_known_dp", ret ); + MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ecp_group_load", ret ); return( ret ); } diff --git a/programs/test/benchmark.c b/programs/test/benchmark.c index 9f8990ffe..2f11693cb 100644 --- a/programs/test/benchmark.c +++ b/programs/test/benchmark.c @@ -729,7 +729,7 @@ int main( int argc, char *argv[] ) { mbedtls_ecdh_init( &ecdh ); - if( mbedtls_ecp_use_known_dp( &ecdh.grp, curve_info->grp_id ) != 0 || + if( mbedtls_ecp_group_load( &ecdh.grp, curve_info->grp_id ) != 0 || mbedtls_ecdh_make_public( &ecdh, &olen, buf, sizeof( buf), myrand, NULL ) != 0 || mbedtls_ecp_copy( &ecdh.Qp, &ecdh.Q ) != 0 ) @@ -753,7 +753,7 @@ int main( int argc, char *argv[] ) mbedtls_ecdh_init( &ecdh ); mbedtls_mpi_init( &z ); - if( mbedtls_ecp_use_known_dp( &ecdh.grp, MBEDTLS_ECP_DP_M255 ) != 0 || + if( mbedtls_ecp_group_load( &ecdh.grp, MBEDTLS_ECP_DP_M255 ) != 0 || mbedtls_ecdh_gen_public( &ecdh.grp, &ecdh.d, &ecdh.Qp, myrand, NULL ) != 0 ) { mbedtls_exit( 1 ); @@ -775,7 +775,7 @@ int main( int argc, char *argv[] ) { mbedtls_ecdh_init( &ecdh ); - if( mbedtls_ecp_use_known_dp( &ecdh.grp, curve_info->grp_id ) != 0 || + if( mbedtls_ecp_group_load( &ecdh.grp, curve_info->grp_id ) != 0 || mbedtls_ecdh_make_public( &ecdh, &olen, buf, sizeof( buf), myrand, NULL ) != 0 || mbedtls_ecp_copy( &ecdh.Qp, &ecdh.Q ) != 0 || @@ -799,7 +799,7 @@ int main( int argc, char *argv[] ) mbedtls_ecdh_init( &ecdh ); mbedtls_mpi_init( &z ); - if( mbedtls_ecp_use_known_dp( &ecdh.grp, MBEDTLS_ECP_DP_M255 ) != 0 || + if( mbedtls_ecp_group_load( &ecdh.grp, MBEDTLS_ECP_DP_M255 ) != 0 || mbedtls_ecdh_gen_public( &ecdh.grp, &ecdh.d, &ecdh.Qp, myrand, NULL ) != 0 || mbedtls_ecdh_gen_public( &ecdh.grp, &ecdh.d, &ecdh.Q, myrand, NULL ) != 0 ) diff --git a/scripts/data_files/rename-1.3-2.0.txt b/scripts/data_files/rename-1.3-2.0.txt index f86341ebf..c5c5d002c 100644 --- a/scripts/data_files/rename-1.3-2.0.txt +++ b/scripts/data_files/rename-1.3-2.0.txt @@ -1532,7 +1532,7 @@ ecp_tls_read_group mbedtls_ecp_tls_read_group ecp_tls_read_point mbedtls_ecp_tls_read_point ecp_tls_write_group mbedtls_ecp_tls_write_group ecp_tls_write_point mbedtls_ecp_tls_write_point -ecp_use_known_dp mbedtls_ecp_use_known_dp +ecp_use_known_dp mbedtls_ecp_group_load entropy_add_source mbedtls_entropy_add_source entropy_context mbedtls_entropy_context entropy_free mbedtls_entropy_free diff --git a/tests/suites/test_suite_ecdh.function b/tests/suites/test_suite_ecdh.function index d5ebb6349..4c6a97baf 100644 --- a/tests/suites/test_suite_ecdh.function +++ b/tests/suites/test_suite_ecdh.function @@ -21,7 +21,7 @@ void ecdh_primitive_random( int id ) mbedtls_mpi_init( &zA ); mbedtls_mpi_init( &zB ); memset( &rnd_info, 0x00, sizeof( rnd_pseudo_info ) ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 ); TEST_ASSERT( mbedtls_ecdh_gen_public( &grp, &dA, &qA, &rnd_pseudo_rand, &rnd_info ) == 0 ); @@ -59,7 +59,7 @@ void ecdh_primitive_testvec( int id, char *dA_str, char *xA_str, char *yA_str, mbedtls_mpi_init( &dA ); mbedtls_mpi_init( &dB ); mbedtls_mpi_init( &zA ); mbedtls_mpi_init( &zB ); mbedtls_mpi_init( &check ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 ); rnd_info_A.buf = rnd_buf_A; rnd_info_A.length = unhexify( rnd_buf_A, dA_str ); @@ -136,7 +136,7 @@ void ecdh_exchange( int id ) mbedtls_ecdh_init( &cli ); memset( &rnd_info, 0x00, sizeof( rnd_pseudo_info ) ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &srv.grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &srv.grp, id ) == 0 ); memset( buf, 0x00, sizeof( buf ) ); vbuf = buf; TEST_ASSERT( mbedtls_ecdh_make_params( &srv, &len, buf, 1000, diff --git a/tests/suites/test_suite_ecdsa.function b/tests/suites/test_suite_ecdsa.function index 8194fe169..88e07a9e6 100644 --- a/tests/suites/test_suite_ecdsa.function +++ b/tests/suites/test_suite_ecdsa.function @@ -24,7 +24,7 @@ void ecdsa_prim_random( int id ) /* prepare material for signature */ TEST_ASSERT( rnd_pseudo_rand( &rnd_info, buf, sizeof( buf ) ) == 0 ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 ); TEST_ASSERT( mbedtls_ecp_gen_keypair( &grp, &d, &Q, &rnd_pseudo_rand, &rnd_info ) == 0 ); @@ -58,7 +58,7 @@ void ecdsa_prim_test_vectors( int id, char *d_str, char *xQ_str, char *yQ_str, memset( hash, 0, sizeof( hash ) ); memset( rnd_buf, 0, sizeof( rnd_buf ) ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 ); TEST_ASSERT( mbedtls_ecp_point_read_string( &Q, 16, xQ_str, yQ_str ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_string( &d, 16, d_str ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_string( &r_check, 16, r_str ) == 0 ); @@ -110,7 +110,7 @@ void ecdsa_det_test_vectors( int id, char *d_str, int md_alg, mbedtls_mpi_init( &r_check ); mbedtls_mpi_init( &s_check ); memset( hash, 0, sizeof( hash ) ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_string( &d, 16, d_str ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_string( &r_check, 16, r_str ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_string( &s_check, 16, s_str ) == 0 ); diff --git a/tests/suites/test_suite_ecp.function b/tests/suites/test_suite_ecp.function index de56d4878..fb68a0fdb 100644 --- a/tests/suites/test_suite_ecp.function +++ b/tests/suites/test_suite_ecp.function @@ -37,7 +37,7 @@ void ecp_check_pub_mx( int grp_id, char *key_hex, int ret ) mbedtls_ecp_group_init( &grp ); mbedtls_ecp_point_init( &P ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &grp, grp_id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &grp, grp_id ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_string( &P.X, 16, key_hex ) == 0 ); TEST_ASSERT( mbedtls_mpi_lset( &P.Z, 1 ) == 0 ); @@ -65,7 +65,7 @@ void ecp_test_vect( int id, char *dA_str, char *xA_str, char *yA_str, mbedtls_mpi_init( &xB ); mbedtls_mpi_init( &yB ); mbedtls_mpi_init( &xZ ); mbedtls_mpi_init( &yZ ); memset( &rnd_info, 0x00, sizeof( rnd_pseudo_info ) ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 ); TEST_ASSERT( mbedtls_ecp_check_pubkey( &grp, &grp.G ) == 0 ); @@ -120,7 +120,7 @@ void ecp_test_vec_x( int id, char *dA_hex, char *xA_hex, mbedtls_mpi_init( &xS ); memset( &rnd_info, 0x00, sizeof( rnd_pseudo_info ) ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 ); TEST_ASSERT( mbedtls_ecp_check_pubkey( &grp, &grp.G ) == 0 ); @@ -166,7 +166,7 @@ void ecp_fast_mod( int id, char *N_str ) mbedtls_ecp_group_init( &grp ); TEST_ASSERT( mbedtls_mpi_read_string( &N, 16, N_str ) == 0 ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 ); TEST_ASSERT( grp.modp != NULL ); /* @@ -203,7 +203,7 @@ void ecp_write_binary( int id, char *x, char *y, char *z, int format, mbedtls_ecp_group_init( &grp ); mbedtls_ecp_point_init( &P ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_string( &P.X, 16, x ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_string( &P.Y, 16, y ) == 0 ); @@ -238,7 +238,7 @@ void ecp_read_binary( int id, char *input, char *x, char *y, char *z, mbedtls_ecp_group_init( &grp ); mbedtls_ecp_point_init( &P ); mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Y ); mbedtls_mpi_init( &Z ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_string( &X, 16, x ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_string( &Y, 16, y ) == 0 ); @@ -277,7 +277,7 @@ void mbedtls_ecp_tls_read_point( int id, char *input, char *x, char *y, char *z, mbedtls_ecp_group_init( &grp ); mbedtls_ecp_point_init( &P ); mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Y ); mbedtls_mpi_init( &Z ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_string( &X, 16, x ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_string( &Y, 16, y ) == 0 ); @@ -313,7 +313,7 @@ void ecp_tls_write_read_point( int id ) mbedtls_ecp_group_init( &grp ); mbedtls_ecp_point_init( &pt ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 ); memset( buf, 0x00, sizeof( buf ) ); vbuf = buf; TEST_ASSERT( mbedtls_ecp_tls_write_point( &grp, &grp.G, @@ -393,7 +393,7 @@ void ecp_tls_write_read_group( int id ) mbedtls_ecp_group_init( &grp2 ); memset( buf, 0x00, sizeof( buf ) ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &grp1, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &grp1, id ) == 0 ); TEST_ASSERT( mbedtls_ecp_tls_write_group( &grp1, &len, buf, 10 ) == 0 ); ret = mbedtls_ecp_tls_read_group( &grp2, &vbuf, len ); @@ -420,7 +420,7 @@ void mbedtls_ecp_check_privkey( int id, char *key_hex, int ret ) mbedtls_ecp_group_init( &grp ); mbedtls_mpi_init( &d ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_string( &d, 16, key_hex ) == 0 ); TEST_ASSERT( mbedtls_ecp_check_privkey( &grp, &d ) == ret ); @@ -441,11 +441,11 @@ void mbedtls_ecp_check_pub_priv( int id_pub, char *Qx_pub, char *Qy_pub, mbedtls_ecp_keypair_init( &prv ); if( id_pub != MBEDTLS_ECP_DP_NONE ) - TEST_ASSERT( mbedtls_ecp_use_known_dp( &pub.grp, id_pub ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &pub.grp, id_pub ) == 0 ); TEST_ASSERT( mbedtls_ecp_point_read_string( &pub.Q, 16, Qx_pub, Qy_pub ) == 0 ); if( id != MBEDTLS_ECP_DP_NONE ) - TEST_ASSERT( mbedtls_ecp_use_known_dp( &prv.grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &prv.grp, id ) == 0 ); TEST_ASSERT( mbedtls_ecp_point_read_string( &prv.Q, 16, Qx, Qy ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_string( &prv.d, 16, d ) == 0 ); @@ -470,7 +470,7 @@ void mbedtls_ecp_gen_keypair( int id ) mbedtls_mpi_init( &d ); memset( &rnd_info, 0x00, sizeof( rnd_pseudo_info ) ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &grp, id ) == 0 ); TEST_ASSERT( mbedtls_ecp_gen_keypair( &grp, &d, &Q, &rnd_pseudo_rand, &rnd_info ) == 0 ); diff --git a/tests/suites/test_suite_pk.function b/tests/suites/test_suite_pk.function index 93223a4fe..cecc3f7ce 100644 --- a/tests/suites/test_suite_pk.function +++ b/tests/suites/test_suite_pk.function @@ -24,7 +24,7 @@ static int pk_genkey( mbedtls_pk_context *pk ) mbedtls_pk_get_type( pk ) == MBEDTLS_PK_ECDSA ) { int ret; - if( ( ret = mbedtls_ecp_use_known_dp( &mbedtls_pk_ec( *pk )->grp, + if( ( ret = mbedtls_ecp_group_load( &mbedtls_pk_ec( *pk )->grp, MBEDTLS_ECP_DP_SECP192R1 ) ) != 0 ) return( ret ); @@ -238,7 +238,7 @@ void pk_ec_test_vec( int type, int id, char *key_str, TEST_ASSERT( mbedtls_pk_can_do( &pk, MBEDTLS_PK_ECDSA ) ); eckey = mbedtls_pk_ec( pk ); - TEST_ASSERT( mbedtls_ecp_use_known_dp( &eckey->grp, id ) == 0 ); + TEST_ASSERT( mbedtls_ecp_group_load( &eckey->grp, id ) == 0 ); TEST_ASSERT( mbedtls_ecp_point_read_binary( &eckey->grp, &eckey->Q, key, key_len ) == 0 );