1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Rename ecp_use_known_dp -> mbedtls_ecp_group_load()

This commit is contained in:
Manuel Pégourié-Gonnard
2015-05-11 18:46:47 +02:00
parent 56cc88a796
commit e3a062ba1f
14 changed files with 41 additions and 41 deletions

View File

@ -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 ) );
}

View File

@ -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 )

View File

@ -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 );

View File

@ -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 );

View File

@ -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 );
}