Lines Matching refs:P
101 static int dhm_check_range( const mbedtls_mpi *param, const mbedtls_mpi *P ) in dhm_check_range() argument
108 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_int( &U, P, 2 ) ); in dhm_check_range()
139 if( ( ret = dhm_read_bignum( &ctx->P, p, end ) ) != 0 || in mbedtls_dhm_read_params()
144 if( ( ret = dhm_check_range( &ctx->GY, &ctx->P ) ) != 0 ) in mbedtls_dhm_read_params()
147 ctx->len = mbedtls_mpi_size( &ctx->P ); in mbedtls_dhm_read_params()
173 if( mbedtls_mpi_cmp_int( &ctx->P, 0 ) == 0 ) in dhm_make_common()
178 if( (unsigned) x_size < mbedtls_mpi_size( &ctx->P ) ) in dhm_make_common()
185 ret = dhm_random_below( &ctx->X, &ctx->P, f_rng, p_rng ); in dhm_make_common()
196 &ctx->P , &ctx->RP ) ); in dhm_make_common()
198 if( ( ret = dhm_check_range( &ctx->GX, &ctx->P ) ) != 0 ) in dhm_make_common()
239 n1 = mbedtls_mpi_size( &ctx->P ); in mbedtls_dhm_make_params()
244 DHM_MPI_EXPORT( &ctx->P , n1 ); in mbedtls_dhm_make_params()
262 const mbedtls_mpi *P, in mbedtls_dhm_set_group() argument
267 DHM_VALIDATE_RET( P != NULL ); in mbedtls_dhm_set_group()
270 if( ( ret = mbedtls_mpi_copy( &ctx->P, P ) ) != 0 || in mbedtls_dhm_set_group()
276 ctx->len = mbedtls_mpi_size( &ctx->P ); in mbedtls_dhm_set_group()
364 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( &ctx->Vi, &ctx->Vi, &ctx->P ) ); in dhm_update_blinding()
367 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( &ctx->Vf, &ctx->Vf, &ctx->P ) ); in dhm_update_blinding()
377 MBEDTLS_MPI_CHK( dhm_random_below( &ctx->Vi, &ctx->P, f_rng, p_rng ) ); in dhm_update_blinding()
382 MBEDTLS_MPI_CHK( dhm_random_below( &R, &ctx->P, f_rng, p_rng ) ); in dhm_update_blinding()
384 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( &ctx->Vf, &ctx->Vf, &ctx->P ) ); in dhm_update_blinding()
385 MBEDTLS_MPI_CHK( mbedtls_mpi_inv_mod( &ctx->Vf, &ctx->Vf, &ctx->P ) ); in dhm_update_blinding()
387 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( &ctx->Vf, &ctx->Vf, &ctx->P ) ); in dhm_update_blinding()
389 MBEDTLS_MPI_CHK( mbedtls_mpi_exp_mod( &ctx->Vf, &ctx->Vf, &ctx->X, &ctx->P, &ctx->RP ) ); in dhm_update_blinding()
414 if( ( ret = dhm_check_range( &ctx->GY, &ctx->P ) ) != 0 ) in mbedtls_dhm_calc_secret()
424 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( &GYb, &GYb, &ctx->P ) ); in mbedtls_dhm_calc_secret()
431 &ctx->P, &ctx->RP ) ); in mbedtls_dhm_calc_secret()
437 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( &ctx->K, &ctx->K, &ctx->P ) ); in mbedtls_dhm_calc_secret()
471 mbedtls_mpi_free( &ctx->P ); in mbedtls_dhm_free()
537 if( ( ret = mbedtls_asn1_get_mpi( &p, end, &dhm->P ) ) != 0 || in mbedtls_dhm_parse_dhm()
567 dhm->len = mbedtls_mpi_size( &dhm->P ); in mbedtls_dhm_parse_dhm()