Rename ecp_use_known_dp -> mbedtls_ecp_group_load()
This commit is contained in:
parent
56cc88a796
commit
e3a062ba1f
@ -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
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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
|
||||
|
@ -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 ) );
|
||||
}
|
||||
|
||||
|
@ -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 )
|
||||
|
@ -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 );
|
||||
|
||||
|
@ -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 );
|
||||
|
@ -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 );
|
||||
}
|
||||
|
||||
|
@ -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 )
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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 );
|
||||
|
@ -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 );
|
||||
|
@ -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 );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user