Lines Matching refs:grp

51     return( ctx->grp.id );  in mbedtls_ecdh_grp_id()
72 static int ecdh_gen_public_restartable( mbedtls_ecp_group *grp, in ecdh_gen_public_restartable() argument
84 MBEDTLS_MPI_CHK( mbedtls_ecp_gen_privkey( grp, d, f_rng, p_rng ) ); in ecdh_gen_public_restartable()
86 MBEDTLS_MPI_CHK( mbedtls_ecp_mul_restartable( grp, Q, d, &grp->G, in ecdh_gen_public_restartable()
96 int mbedtls_ecdh_gen_public( mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q, in mbedtls_ecdh_gen_public() argument
100 ECDH_VALIDATE_RET( grp != NULL ); in mbedtls_ecdh_gen_public()
104 return( ecdh_gen_public_restartable( grp, d, Q, f_rng, p_rng, NULL ) ); in mbedtls_ecdh_gen_public()
112 static int ecdh_compute_shared_restartable( mbedtls_ecp_group *grp, in ecdh_compute_shared_restartable() argument
124 MBEDTLS_MPI_CHK( mbedtls_ecp_mul_restartable( grp, &P, d, Q, in ecdh_compute_shared_restartable()
144 int mbedtls_ecdh_compute_shared( mbedtls_ecp_group *grp, mbedtls_mpi *z, in mbedtls_ecdh_compute_shared() argument
149 ECDH_VALIDATE_RET( grp != NULL ); in mbedtls_ecdh_compute_shared()
153 return( ecdh_compute_shared_restartable( grp, z, Q, d, in mbedtls_ecdh_compute_shared()
160 mbedtls_ecp_group_init( &ctx->grp ); in ecdh_init_internal()
199 ret = mbedtls_ecp_group_load( &ctx->grp, grp_id ); in ecdh_setup_internal()
239 mbedtls_ecp_group_free( &ctx->grp ); in ecdh_free_internal()
311 if( ctx->grp.pbits == 0 ) in ecdh_make_params_internal()
323 if( ( ret = ecdh_gen_public_restartable( &ctx->grp, &ctx->d, &ctx->Q, in ecdh_make_params_internal()
327 if( ( ret = mbedtls_ecdh_gen_public( &ctx->grp, &ctx->d, &ctx->Q, in ecdh_make_params_internal()
332 if( ( ret = mbedtls_ecp_tls_write_group( &ctx->grp, &grp_len, buf, in ecdh_make_params_internal()
339 if( ( ret = mbedtls_ecp_tls_write_point( &ctx->grp, &ctx->Q, point_format, in ecdh_make_params_internal()
397 return( mbedtls_ecp_tls_read_point( &ctx->grp, &ctx->Qp, buf, in ecdh_read_params_internal()
483 if( ( ret = mbedtls_ecdh_setup( ctx, key->grp.id ) ) != 0 ) in mbedtls_ecdh_get_params()
491 if( mbedtls_ecdh_grp_id( ctx ) != key->grp.id ) in mbedtls_ecdh_get_params()
533 if( ctx->grp.pbits == 0 ) in ecdh_make_public_internal()
544 if( ( ret = ecdh_gen_public_restartable( &ctx->grp, &ctx->d, &ctx->Q, in ecdh_make_public_internal()
548 if( ( ret = mbedtls_ecdh_gen_public( &ctx->grp, &ctx->d, &ctx->Q, in ecdh_make_public_internal()
553 return mbedtls_ecp_tls_write_point( &ctx->grp, &ctx->Q, point_format, olen, in ecdh_make_public_internal()
603 if( ( ret = mbedtls_ecp_tls_read_point( &ctx->grp, &ctx->Qp, &p, in ecdh_read_public_internal()
655 if( ctx == NULL || ctx->grp.pbits == 0 ) in ecdh_calc_secret_internal()
666 if( ( ret = ecdh_compute_shared_restartable( &ctx->grp, &ctx->z, &ctx->Qp, in ecdh_calc_secret_internal()
673 if( ( ret = mbedtls_ecdh_compute_shared( &ctx->grp, &ctx->z, &ctx->Qp, in ecdh_calc_secret_internal()
683 *olen = ctx->grp.pbits / 8 + ( ( ctx->grp.pbits % 8 ) != 0 ); in ecdh_calc_secret_internal()
685 if( mbedtls_ecp_get_type( &ctx->grp ) == MBEDTLS_ECP_TYPE_MONTGOMERY ) in ecdh_calc_secret_internal()