Lines Matching refs:grp
45 return( ctx->grp.id ); in mbedtls_ecdh_grp_id()
66 static int ecdh_gen_public_restartable( mbedtls_ecp_group *grp, in ecdh_gen_public_restartable() argument
80 MBEDTLS_MPI_CHK( mbedtls_ecp_gen_privkey( grp, d, f_rng, p_rng ) ); in ecdh_gen_public_restartable()
82 MBEDTLS_MPI_CHK( mbedtls_ecp_mul_restartable( grp, Q, d, &grp->G, in ecdh_gen_public_restartable()
92 int mbedtls_ecdh_gen_public( mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q, in mbedtls_ecdh_gen_public() argument
96 return( ecdh_gen_public_restartable( grp, d, Q, f_rng, p_rng, NULL ) ); in mbedtls_ecdh_gen_public()
104 static int ecdh_compute_shared_restartable( mbedtls_ecp_group *grp, in ecdh_compute_shared_restartable() argument
116 MBEDTLS_MPI_CHK( mbedtls_ecp_mul_restartable( grp, &P, d, Q, in ecdh_compute_shared_restartable()
136 int mbedtls_ecdh_compute_shared( mbedtls_ecp_group *grp, mbedtls_mpi *z, in mbedtls_ecdh_compute_shared() argument
141 return( ecdh_compute_shared_restartable( grp, z, Q, d, in mbedtls_ecdh_compute_shared()
148 mbedtls_ecp_group_init( &ctx->grp ); in ecdh_init_internal()
185 ret = mbedtls_ecp_group_load( &ctx->grp, grp_id ); in ecdh_setup_internal()
223 mbedtls_ecp_group_free( &ctx->grp ); in ecdh_free_internal()
293 if( ctx->grp.pbits == 0 ) in ecdh_make_params_internal()
305 if( ( ret = ecdh_gen_public_restartable( &ctx->grp, &ctx->d, &ctx->Q, in ecdh_make_params_internal()
309 if( ( ret = mbedtls_ecdh_gen_public( &ctx->grp, &ctx->d, &ctx->Q, in ecdh_make_params_internal()
314 if( ( ret = mbedtls_ecp_tls_write_group( &ctx->grp, &grp_len, buf, in ecdh_make_params_internal()
321 if( ( ret = mbedtls_ecp_tls_write_point( &ctx->grp, &ctx->Q, point_format, in ecdh_make_params_internal()
374 return( mbedtls_ecp_tls_read_point( &ctx->grp, &ctx->Qp, buf, in ecdh_read_params_internal()
453 if( ( ret = mbedtls_ecdh_setup( ctx, key->grp.id ) ) != 0 ) in mbedtls_ecdh_get_params()
461 if( mbedtls_ecdh_grp_id( ctx ) != key->grp.id ) in mbedtls_ecdh_get_params()
503 if( ctx->grp.pbits == 0 ) in ecdh_make_public_internal()
514 if( ( ret = ecdh_gen_public_restartable( &ctx->grp, &ctx->d, &ctx->Q, in ecdh_make_public_internal()
518 if( ( ret = mbedtls_ecdh_gen_public( &ctx->grp, &ctx->d, &ctx->Q, in ecdh_make_public_internal()
523 return mbedtls_ecp_tls_write_point( &ctx->grp, &ctx->Q, point_format, olen, in ecdh_make_public_internal()
568 if( ( ret = mbedtls_ecp_tls_read_point( &ctx->grp, &ctx->Qp, &p, in ecdh_read_public_internal()
617 if( ctx == NULL || ctx->grp.pbits == 0 ) in ecdh_calc_secret_internal()
628 if( ( ret = ecdh_compute_shared_restartable( &ctx->grp, &ctx->z, &ctx->Qp, in ecdh_calc_secret_internal()
635 if( ( ret = mbedtls_ecdh_compute_shared( &ctx->grp, &ctx->z, &ctx->Qp, in ecdh_calc_secret_internal()
645 *olen = ctx->grp.pbits / 8 + ( ( ctx->grp.pbits % 8 ) != 0 ); in ecdh_calc_secret_internal()
647 if( mbedtls_ecp_get_type( &ctx->grp ) == MBEDTLS_ECP_TYPE_MONTGOMERY ) in ecdh_calc_secret_internal()