Lines Matching refs:R

300     mbedtls_ecp_point R;    /* current intermediate result                  */  member
324 mbedtls_ecp_point_init( &ctx->R ); in ecp_restart_rsm_init()
345 mbedtls_ecp_point_free( &ctx->R ); in ecp_restart_rsm_free()
367 mbedtls_ecp_point R; /* R intermediate result */ member
382 mbedtls_ecp_point_init( &ctx->R ); in ecp_restart_ma_init()
395 mbedtls_ecp_point_free( &ctx->R ); in ecp_restart_ma_free()
1503 static int ecp_double_jac( const mbedtls_ecp_group *grp, mbedtls_ecp_point *R, in ecp_double_jac() argument
1512 return( mbedtls_internal_ecp_double_jac( grp, R, P ) ); in ecp_double_jac()
1574 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &R->X, &T ) ); in ecp_double_jac()
1575 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &R->Y, &S ) ); in ecp_double_jac()
1576 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &R->Z, &U ) ); in ecp_double_jac()
1603 static int ecp_add_mixed( const mbedtls_ecp_group *grp, mbedtls_ecp_point *R, in ecp_add_mixed() argument
1612 return( mbedtls_internal_ecp_add_mixed( grp, R, P, Q ) ); in ecp_add_mixed()
1625 return( mbedtls_ecp_copy( R, Q ) ); in ecp_add_mixed()
1628 return( mbedtls_ecp_copy( R, P ) ); in ecp_add_mixed()
1651 ret = ecp_double_jac( grp, R, P ); in ecp_add_mixed()
1656 ret = mbedtls_ecp_set_zero( R ); in ecp_add_mixed()
1675 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &R->X, &X ) ); in ecp_add_mixed()
1676 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &R->Y, &Y ) ); in ecp_add_mixed()
1677 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &R->Z, &Z ) ); in ecp_add_mixed()
1995 static int ecp_select_comb( const mbedtls_ecp_group *grp, mbedtls_ecp_point *R, in ecp_select_comb() argument
2008 MBEDTLS_MPI_CHK( mbedtls_mpi_safe_cond_assign( &R->X, &T[j].X, j == ii ) ); in ecp_select_comb()
2009 MBEDTLS_MPI_CHK( mbedtls_mpi_safe_cond_assign( &R->Y, &T[j].Y, j == ii ) ); in ecp_select_comb()
2013 MBEDTLS_MPI_CHK( ecp_safe_invert_jac( grp, R, i >> 7 ) ); in ecp_select_comb()
2025 static int ecp_mul_comb_core( const mbedtls_ecp_group *grp, mbedtls_ecp_point *R, in ecp_mul_comb_core() argument
2061 MBEDTLS_MPI_CHK( ecp_select_comb( grp, R, T, T_size, x[i] ) ); in ecp_mul_comb_core()
2062 MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &R->Z, 1 ) ); in ecp_mul_comb_core()
2066 MBEDTLS_MPI_CHK( ecp_randomize_jac( grp, R, f_rng, p_rng ) ); in ecp_mul_comb_core()
2074 MBEDTLS_MPI_CHK( ecp_double_jac( grp, R, R ) ); in ecp_mul_comb_core()
2076 MBEDTLS_MPI_CHK( ecp_add_mixed( grp, R, R, &Txi ) ); in ecp_mul_comb_core()
2150 mbedtls_ecp_point *R, in ecp_mul_comb_after_precomp() argument
2163 mbedtls_ecp_point *RR = R; in ecp_mul_comb_after_precomp()
2168 RR = &rs_ctx->rsm->R; in ecp_mul_comb_after_precomp()
2208 MBEDTLS_MPI_CHK( mbedtls_ecp_copy( R, RR ) ); in ecp_mul_comb_after_precomp()
2265 static int ecp_mul_comb( mbedtls_ecp_group *grp, mbedtls_ecp_point *R, in ecp_mul_comb() argument
2377 MBEDTLS_MPI_CHK( ecp_mul_comb_after_precomp( grp, R, m, in ecp_mul_comb()
2416 mbedtls_ecp_point_free( R ); in ecp_mul_comb()
2512 mbedtls_ecp_point *R, mbedtls_ecp_point *S, in ecp_double_add_mxz() argument
2518 return( mbedtls_internal_ecp_double_add_mxz( grp, R, S, P, Q, d ) ); in ecp_double_add_mxz()
2545 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mod( grp, &R->X, &AA, &BB ) ); in ecp_double_add_mxz()
2546 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mod( grp, &R->Z, &grp->A, &E ) ); in ecp_double_add_mxz()
2547 MBEDTLS_MPI_CHK( mbedtls_mpi_add_mod( grp, &R->Z, &BB, &R->Z ) ); in ecp_double_add_mxz()
2548 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mod( grp, &R->Z, &E, &R->Z ) ); in ecp_double_add_mxz()
2563 static int ecp_mul_mxz( mbedtls_ecp_group *grp, mbedtls_ecp_point *R, in ecp_mul_mxz() argument
2595 MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &R->X, 1 ) ); in ecp_mul_mxz()
2596 MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &R->Z, 0 ) ); in ecp_mul_mxz()
2597 mbedtls_mpi_free( &R->Y ); in ecp_mul_mxz()
2620 MBEDTLS_MPI_CHK( mbedtls_mpi_safe_cond_swap( &R->X, &RP.X, b ) ); in ecp_mul_mxz()
2621 MBEDTLS_MPI_CHK( mbedtls_mpi_safe_cond_swap( &R->Z, &RP.Z, b ) ); in ecp_mul_mxz()
2622 MBEDTLS_MPI_CHK( ecp_double_add_mxz( grp, R, &RP, R, &RP, &PX ) ); in ecp_mul_mxz()
2623 MBEDTLS_MPI_CHK( mbedtls_mpi_safe_cond_swap( &R->X, &RP.X, b ) ); in ecp_mul_mxz()
2624 MBEDTLS_MPI_CHK( mbedtls_mpi_safe_cond_swap( &R->Z, &RP.Z, b ) ); in ecp_mul_mxz()
2641 MBEDTLS_MPI_CHK( ecp_randomize_mxz( grp, R, f_rng, p_rng ) ); in ecp_mul_mxz()
2643 MBEDTLS_MPI_CHK( ecp_normalize_mxz( grp, R ) ); in ecp_mul_mxz()
2660 int mbedtls_ecp_mul_restartable( mbedtls_ecp_group *grp, mbedtls_ecp_point *R, in mbedtls_ecp_mul_restartable() argument
2670 ECP_VALIDATE_RET( R != NULL ); in mbedtls_ecp_mul_restartable()
2703 MBEDTLS_MPI_CHK( ecp_mul_mxz( grp, R, m, P, f_rng, p_rng ) ); in mbedtls_ecp_mul_restartable()
2707 MBEDTLS_MPI_CHK( ecp_mul_comb( grp, R, m, P, f_rng, p_rng, rs_ctx ) ); in mbedtls_ecp_mul_restartable()
2728 int mbedtls_ecp_mul( mbedtls_ecp_group *grp, mbedtls_ecp_point *R, in mbedtls_ecp_mul() argument
2733 ECP_VALIDATE_RET( R != NULL ); in mbedtls_ecp_mul()
2736 return( mbedtls_ecp_mul_restartable( grp, R, m, P, f_rng, p_rng, NULL ) ); in mbedtls_ecp_mul()
2795 mbedtls_ecp_point *R, in mbedtls_ecp_mul_shortcuts() argument
2804 MBEDTLS_MPI_CHK( mbedtls_ecp_set_zero( R ) ); in mbedtls_ecp_mul_shortcuts()
2808 MBEDTLS_MPI_CHK( mbedtls_ecp_copy( R, P ) ); in mbedtls_ecp_mul_shortcuts()
2812 MBEDTLS_MPI_CHK( mbedtls_ecp_copy( R, P ) ); in mbedtls_ecp_mul_shortcuts()
2813 if( mbedtls_mpi_cmp_int( &R->Y, 0 ) != 0 ) in mbedtls_ecp_mul_shortcuts()
2814 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &R->Y, &grp->P, &R->Y ) ); in mbedtls_ecp_mul_shortcuts()
2818 MBEDTLS_MPI_CHK( mbedtls_ecp_mul_restartable( grp, R, m, P, in mbedtls_ecp_mul_shortcuts()
2831 mbedtls_ecp_group *grp, mbedtls_ecp_point *R, in mbedtls_ecp_muladd_restartable() argument
2839 mbedtls_ecp_point *pR = R; in mbedtls_ecp_muladd_restartable()
2844 ECP_VALIDATE_RET( R != NULL ); in mbedtls_ecp_muladd_restartable()
2862 pR = &rs_ctx->ma->R; in mbedtls_ecp_muladd_restartable()
2907 MBEDTLS_MPI_CHK( mbedtls_ecp_copy( R, pR ) ); in mbedtls_ecp_muladd_restartable()
2927 int mbedtls_ecp_muladd( mbedtls_ecp_group *grp, mbedtls_ecp_point *R, in mbedtls_ecp_muladd() argument
2932 ECP_VALIDATE_RET( R != NULL ); in mbedtls_ecp_muladd()
2937 return( mbedtls_ecp_muladd_restartable( grp, R, m, P, n, Q, NULL ) ); in mbedtls_ecp_muladd()
3442 mbedtls_ecp_point *R, in self_test_point() argument
3457 MBEDTLS_MPI_CHK( mbedtls_ecp_mul( grp, R, m, P, NULL, NULL ) ); in self_test_point()
3470 MBEDTLS_MPI_CHK( mbedtls_ecp_mul( grp, R, m, P, NULL, NULL ) ); in self_test_point()
3499 mbedtls_ecp_point R, P; in mbedtls_ecp_self_test() local
3532 mbedtls_ecp_point_init( &R ); in mbedtls_ecp_self_test()
3550 &grp, &R, &m, &grp.G, in mbedtls_ecp_self_test()
3560 &grp, &R, &m, &P, in mbedtls_ecp_self_test()
3567 mbedtls_ecp_point_free( &R ); in mbedtls_ecp_self_test()
3581 &grp, &R, &m, &grp.G, in mbedtls_ecp_self_test()
3594 mbedtls_ecp_point_free( &R ); in mbedtls_ecp_self_test()