Lines Matching refs:MBEDTLS_MPI_CHK
367 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &P->X, &Q->X ) ); in mbedtls_ecp_copy()
368 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &P->Y, &Q->Y ) ); in mbedtls_ecp_copy()
369 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &P->Z, &Q->Z ) ); in mbedtls_ecp_copy()
390 MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &pt->X , 1 ) ); in mbedtls_ecp_set_zero()
391 MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &pt->Y , 1 ) ); in mbedtls_ecp_set_zero()
392 MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &pt->Z , 0 ) ); in mbedtls_ecp_set_zero()
430 MBEDTLS_MPI_CHK( mbedtls_mpi_read_string( &P->X, radix, x ) ); in mbedtls_ecp_point_read_string()
431 MBEDTLS_MPI_CHK( mbedtls_mpi_read_string( &P->Y, radix, y ) ); in mbedtls_ecp_point_read_string()
432 MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &P->Z, 1 ) ); in mbedtls_ecp_point_read_string()
476 MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( &P->X, buf + 1, plen ) ); in mbedtls_ecp_point_write_binary()
477 MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( &P->Y, buf + 1 + plen, plen ) ); in mbedtls_ecp_point_write_binary()
487 MBEDTLS_MPI_CHK( mbedtls_mpi_write_binary( &P->X, buf + 1, plen ) ); in mbedtls_ecp_point_write_binary()
522 MBEDTLS_MPI_CHK( mbedtls_mpi_read_binary( &pt->X, buf + 1, plen ) ); in mbedtls_ecp_point_read_binary()
523 MBEDTLS_MPI_CHK( mbedtls_mpi_read_binary( &pt->Y, buf + 1 + plen, plen ) ); in mbedtls_ecp_point_read_binary()
524 MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &pt->Z, 1 ) ); in mbedtls_ecp_point_read_binary()
677 MBEDTLS_MPI_CHK( grp->modp( N ) ); in ecp_modp()
681 MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( N, N, &grp->P ) ); in ecp_modp()
685 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_abs( N, N, &grp->P ) ); in ecp_modp()
710 #define MOD_MUL( N ) do { MBEDTLS_MPI_CHK( ecp_modp( &N, grp ) ); INC_MUL_COUNT } \
719 MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( &N, &N, &grp->P ) )
728 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_abs( &N, &N, &grp->P ) )
756 MBEDTLS_MPI_CHK( mbedtls_mpi_inv_mod( &Zi, &pt->Z, &grp->P ) ); in ecp_normalize_jac()
757 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &ZZi, &Zi, &Zi ) ); MOD_MUL( ZZi ); in ecp_normalize_jac()
758 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &pt->X, &pt->X, &ZZi ) ); MOD_MUL( pt->X ); in ecp_normalize_jac()
763 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &pt->Y, &pt->Y, &ZZi ) ); MOD_MUL( pt->Y ); in ecp_normalize_jac()
764 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &pt->Y, &pt->Y, &Zi ) ); MOD_MUL( pt->Y ); in ecp_normalize_jac()
769 MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &pt->Z, 1 ) ); in ecp_normalize_jac()
807 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &c[0], &T[0]->Z ) ); in ecp_normalize_jac_many()
810 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &c[i], &c[i-1], &T[i]->Z ) ); in ecp_normalize_jac_many()
817 MBEDTLS_MPI_CHK( mbedtls_mpi_inv_mod( &u, &c[t_len-1], &grp->P ) ); in ecp_normalize_jac_many()
826 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &Zi, &u ) ); in ecp_normalize_jac_many()
830 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &Zi, &u, &c[i-1] ) ); MOD_MUL( Zi ); in ecp_normalize_jac_many()
831 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &u, &u, &T[i]->Z ) ); MOD_MUL( u ); in ecp_normalize_jac_many()
837 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &ZZi, &Zi, &Zi ) ); MOD_MUL( ZZi ); in ecp_normalize_jac_many()
838 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &T[i]->X, &T[i]->X, &ZZi ) ); MOD_MUL( T[i]->X ); in ecp_normalize_jac_many()
839 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &T[i]->Y, &T[i]->Y, &ZZi ) ); MOD_MUL( T[i]->Y ); in ecp_normalize_jac_many()
840 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &T[i]->Y, &T[i]->Y, &Zi ) ); MOD_MUL( T[i]->Y ); in ecp_normalize_jac_many()
848 MBEDTLS_MPI_CHK( mbedtls_mpi_shrink( &T[i]->X, grp->P.n ) ); in ecp_normalize_jac_many()
849 MBEDTLS_MPI_CHK( mbedtls_mpi_shrink( &T[i]->Y, grp->P.n ) ); in ecp_normalize_jac_many()
881 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &mQY, &grp->P, &Q->Y ) ); in ecp_safe_invert_jac()
883 MBEDTLS_MPI_CHK( mbedtls_mpi_safe_cond_assign( &Q->Y, &mQY, inv & nonzero ) ); in ecp_safe_invert_jac()
921 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &S, &P->Z, &P->Z ) ); MOD_MUL( S ); in ecp_double_jac()
922 MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( &T, &P->X, &S ) ); MOD_ADD( T ); in ecp_double_jac()
923 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &U, &P->X, &S ) ); MOD_SUB( U ); in ecp_double_jac()
924 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &S, &T, &U ) ); MOD_MUL( S ); in ecp_double_jac()
925 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_int( &M, &S, 3 ) ); MOD_ADD( M ); in ecp_double_jac()
930 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &S, &P->X, &P->X ) ); MOD_MUL( S ); in ecp_double_jac()
931 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_int( &M, &S, 3 ) ); MOD_ADD( M ); in ecp_double_jac()
937 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &S, &P->Z, &P->Z ) ); MOD_MUL( S ); in ecp_double_jac()
938 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &T, &S, &S ) ); MOD_MUL( T ); in ecp_double_jac()
939 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &S, &T, &grp->A ) ); MOD_MUL( S ); in ecp_double_jac()
940 MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( &M, &M, &S ) ); MOD_ADD( M ); in ecp_double_jac()
945 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &T, &P->Y, &P->Y ) ); MOD_MUL( T ); in ecp_double_jac()
946 MBEDTLS_MPI_CHK( mbedtls_mpi_shift_l( &T, 1 ) ); MOD_ADD( T ); in ecp_double_jac()
947 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &S, &P->X, &T ) ); MOD_MUL( S ); in ecp_double_jac()
948 MBEDTLS_MPI_CHK( mbedtls_mpi_shift_l( &S, 1 ) ); MOD_ADD( S ); in ecp_double_jac()
951 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &U, &T, &T ) ); MOD_MUL( U ); in ecp_double_jac()
952 MBEDTLS_MPI_CHK( mbedtls_mpi_shift_l( &U, 1 ) ); MOD_ADD( U ); in ecp_double_jac()
955 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &T, &M, &M ) ); MOD_MUL( T ); in ecp_double_jac()
956 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &T, &T, &S ) ); MOD_SUB( T ); in ecp_double_jac()
957 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &T, &T, &S ) ); MOD_SUB( T ); in ecp_double_jac()
960 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &S, &S, &T ) ); MOD_SUB( S ); in ecp_double_jac()
961 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &S, &S, &M ) ); MOD_MUL( S ); in ecp_double_jac()
962 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &S, &S, &U ) ); MOD_SUB( S ); in ecp_double_jac()
965 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &U, &P->Y, &P->Z ) ); MOD_MUL( U ); in ecp_double_jac()
966 MBEDTLS_MPI_CHK( mbedtls_mpi_shift_l( &U, 1 ) ); MOD_ADD( U ); in ecp_double_jac()
968 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &R->X, &T ) ); in ecp_double_jac()
969 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &R->Y, &S ) ); in ecp_double_jac()
970 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &R->Z, &U ) ); in ecp_double_jac()
1024 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &T1, &P->Z, &P->Z ) ); MOD_MUL( T1 ); in ecp_add_mixed()
1025 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &T2, &T1, &P->Z ) ); MOD_MUL( T2 ); in ecp_add_mixed()
1026 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &T1, &T1, &Q->X ) ); MOD_MUL( T1 ); in ecp_add_mixed()
1027 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &T2, &T2, &Q->Y ) ); MOD_MUL( T2 ); in ecp_add_mixed()
1028 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &T1, &T1, &P->X ) ); MOD_SUB( T1 ); in ecp_add_mixed()
1029 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &T2, &T2, &P->Y ) ); MOD_SUB( T2 ); in ecp_add_mixed()
1046 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &Z, &P->Z, &T1 ) ); MOD_MUL( Z ); in ecp_add_mixed()
1047 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &T3, &T1, &T1 ) ); MOD_MUL( T3 ); in ecp_add_mixed()
1048 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &T4, &T3, &T1 ) ); MOD_MUL( T4 ); in ecp_add_mixed()
1049 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &T3, &T3, &P->X ) ); MOD_MUL( T3 ); in ecp_add_mixed()
1050 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_int( &T1, &T3, 2 ) ); MOD_ADD( T1 ); in ecp_add_mixed()
1051 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &X, &T2, &T2 ) ); MOD_MUL( X ); in ecp_add_mixed()
1052 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &X, &X, &T1 ) ); MOD_SUB( X ); in ecp_add_mixed()
1053 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &X, &X, &T4 ) ); MOD_SUB( X ); in ecp_add_mixed()
1054 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &T3, &T3, &X ) ); MOD_SUB( T3 ); in ecp_add_mixed()
1055 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &T3, &T3, &T2 ) ); MOD_MUL( T3 ); in ecp_add_mixed()
1056 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &T4, &T4, &P->Y ) ); MOD_MUL( T4 ); in ecp_add_mixed()
1057 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &Y, &T3, &T4 ) ); MOD_SUB( Y ); in ecp_add_mixed()
1059 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &R->X, &X ) ); in ecp_add_mixed()
1060 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &R->Y, &Y ) ); in ecp_add_mixed()
1061 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &R->Z, &Z ) ); in ecp_add_mixed()
1094 MBEDTLS_MPI_CHK( mbedtls_mpi_shift_r( &l, 1 ) ); in ecp_randomize_jac()
1102 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &pt->Z, &pt->Z, &l ) ); MOD_MUL( pt->Z ); in ecp_randomize_jac()
1105 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &ll, &l, &l ) ); MOD_MUL( ll ); in ecp_randomize_jac()
1106 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &pt->X, &pt->X, &ll ) ); MOD_MUL( pt->X ); in ecp_randomize_jac()
1109 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &ll, &ll, &l ) ); MOD_MUL( ll ); in ecp_randomize_jac()
1110 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &pt->Y, &pt->Y, &ll ) ); MOD_MUL( pt->Y ); in ecp_randomize_jac()
1204 MBEDTLS_MPI_CHK( mbedtls_ecp_copy( &T[0], P ) ); in ecp_precompute_comb()
1210 MBEDTLS_MPI_CHK( mbedtls_ecp_copy( cur, T + ( i >> 1 ) ) ); in ecp_precompute_comb()
1212 MBEDTLS_MPI_CHK( ecp_double_jac( grp, cur, cur ) ); in ecp_precompute_comb()
1217 MBEDTLS_MPI_CHK( ecp_normalize_jac_many( grp, TT, k ) ); in ecp_precompute_comb()
1229 MBEDTLS_MPI_CHK( ecp_add_mixed( grp, &T[i + j], &T[j], &T[i] ) ); in ecp_precompute_comb()
1234 MBEDTLS_MPI_CHK( ecp_normalize_jac_many( grp, TT, k ) ); in ecp_precompute_comb()
1256 MBEDTLS_MPI_CHK( mbedtls_mpi_safe_cond_assign( &R->X, &T[j].X, j == ii ) ); in ecp_select_comb()
1257 MBEDTLS_MPI_CHK( mbedtls_mpi_safe_cond_assign( &R->Y, &T[j].Y, j == ii ) ); in ecp_select_comb()
1261 MBEDTLS_MPI_CHK( ecp_safe_invert_jac( grp, R, i >> 7 ) ); in ecp_select_comb()
1287 MBEDTLS_MPI_CHK( ecp_select_comb( grp, R, T, t_len, x[i] ) ); in ecp_mul_comb_core()
1288 MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &R->Z, 1 ) ); in ecp_mul_comb_core()
1290 MBEDTLS_MPI_CHK( ecp_randomize_jac( grp, R, f_rng, p_rng ) ); in ecp_mul_comb_core()
1294 MBEDTLS_MPI_CHK( ecp_double_jac( grp, R, R ) ); in ecp_mul_comb_core()
1295 MBEDTLS_MPI_CHK( ecp_select_comb( grp, &Txi, T, t_len, x[i] ) ); in ecp_mul_comb_core()
1296 MBEDTLS_MPI_CHK( ecp_add_mixed( grp, R, R, &Txi ) ); in ecp_mul_comb_core()
1377 MBEDTLS_MPI_CHK( ecp_precompute_comb( grp, T, P, w, d ) ); in ecp_mul_comb()
1391 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &M, m ) ); in ecp_mul_comb()
1392 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &mm, &grp->N, m ) ); in ecp_mul_comb()
1393 MBEDTLS_MPI_CHK( mbedtls_mpi_safe_cond_assign( &M, &mm, ! m_is_odd ) ); in ecp_mul_comb()
1399 MBEDTLS_MPI_CHK( ecp_mul_comb_core( grp, R, T, pre_len, k, d, f_rng, p_rng ) ); in ecp_mul_comb()
1404 MBEDTLS_MPI_CHK( ecp_safe_invert_jac( grp, R, ! m_is_odd ) ); in ecp_mul_comb()
1405 MBEDTLS_MPI_CHK( ecp_normalize_jac( grp, R ) ); in ecp_mul_comb()
1444 MBEDTLS_MPI_CHK( mbedtls_mpi_inv_mod( &P->Z, &P->Z, &grp->P ) ); in ecp_normalize_mxz()
1445 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &P->X, &P->X, &P->Z ) ); MOD_MUL( P->X ); in ecp_normalize_mxz()
1446 MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &P->Z, 1 ) ); in ecp_normalize_mxz()
1476 MBEDTLS_MPI_CHK( mbedtls_mpi_shift_r( &l, 1 ) ); in ecp_randomize_mxz()
1483 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &P->X, &P->X, &l ) ); MOD_MUL( P->X ); in ecp_randomize_mxz()
1484 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &P->Z, &P->Z, &l ) ); MOD_MUL( P->Z ); in ecp_randomize_mxz()
1519 MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( &A, &P->X, &P->Z ) ); MOD_ADD( A ); in ecp_double_add_mxz()
1520 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &AA, &A, &A ) ); MOD_MUL( AA ); in ecp_double_add_mxz()
1521 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &B, &P->X, &P->Z ) ); MOD_SUB( B ); in ecp_double_add_mxz()
1522 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &BB, &B, &B ) ); MOD_MUL( BB ); in ecp_double_add_mxz()
1523 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &E, &AA, &BB ) ); MOD_SUB( E ); in ecp_double_add_mxz()
1524 MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( &C, &Q->X, &Q->Z ) ); MOD_ADD( C ); in ecp_double_add_mxz()
1525 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &D, &Q->X, &Q->Z ) ); MOD_SUB( D ); in ecp_double_add_mxz()
1526 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &DA, &D, &A ) ); MOD_MUL( DA ); in ecp_double_add_mxz()
1527 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &CB, &C, &B ) ); MOD_MUL( CB ); in ecp_double_add_mxz()
1528 MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( &S->X, &DA, &CB ) ); MOD_MUL( S->X ); in ecp_double_add_mxz()
1529 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &S->X, &S->X, &S->X ) ); MOD_MUL( S->X ); in ecp_double_add_mxz()
1530 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &S->Z, &DA, &CB ) ); MOD_SUB( S->Z ); in ecp_double_add_mxz()
1531 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &S->Z, &S->Z, &S->Z ) ); MOD_MUL( S->Z ); in ecp_double_add_mxz()
1532 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &S->Z, d, &S->Z ) ); MOD_MUL( S->Z ); in ecp_double_add_mxz()
1533 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &R->X, &AA, &BB ) ); MOD_MUL( R->X ); in ecp_double_add_mxz()
1534 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &R->Z, &grp->A, &E ) ); MOD_MUL( R->Z ); in ecp_double_add_mxz()
1535 MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( &R->Z, &BB, &R->Z ) ); MOD_ADD( R->Z ); in ecp_double_add_mxz()
1536 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &R->Z, &E, &R->Z ) ); MOD_MUL( R->Z ); in ecp_double_add_mxz()
1564 MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &PX, &P->X ) ); in ecp_mul_mxz()
1565 MBEDTLS_MPI_CHK( mbedtls_ecp_copy( &RP, P ) ); in ecp_mul_mxz()
1568 MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &R->X, 1 ) ); in ecp_mul_mxz()
1569 MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &R->Z, 0 ) ); in ecp_mul_mxz()
1577 MBEDTLS_MPI_CHK( ecp_randomize_mxz( grp, &RP, f_rng, p_rng ) ); in ecp_mul_mxz()
1591 MBEDTLS_MPI_CHK( mbedtls_mpi_safe_cond_swap( &R->X, &RP.X, b ) ); in ecp_mul_mxz()
1592 MBEDTLS_MPI_CHK( mbedtls_mpi_safe_cond_swap( &R->Z, &RP.Z, b ) ); in ecp_mul_mxz()
1593 MBEDTLS_MPI_CHK( ecp_double_add_mxz( grp, R, &RP, R, &RP, &PX ) ); in ecp_mul_mxz()
1594 MBEDTLS_MPI_CHK( mbedtls_mpi_safe_cond_swap( &R->X, &RP.X, b ) ); in ecp_mul_mxz()
1595 MBEDTLS_MPI_CHK( mbedtls_mpi_safe_cond_swap( &R->Z, &RP.Z, b ) ); in ecp_mul_mxz()
1598 MBEDTLS_MPI_CHK( ecp_normalize_mxz( grp, R ) ); in ecp_mul_mxz()
1659 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &YY, &pt->Y, &pt->Y ) ); MOD_MUL( YY ); in ecp_check_pubkey_sw()
1660 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &RHS, &pt->X, &pt->X ) ); MOD_MUL( RHS ); in ecp_check_pubkey_sw()
1665 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_int( &RHS, &RHS, 3 ) ); MOD_SUB( RHS ); in ecp_check_pubkey_sw()
1669 MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( &RHS, &RHS, &grp->A ) ); MOD_ADD( RHS ); in ecp_check_pubkey_sw()
1672 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &RHS, &RHS, &pt->X ) ); MOD_MUL( RHS ); in ecp_check_pubkey_sw()
1673 MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( &RHS, &RHS, &grp->B ) ); MOD_ADD( RHS ); in ecp_check_pubkey_sw()
1699 MBEDTLS_MPI_CHK( mbedtls_ecp_copy( R, P ) ); in mbedtls_ecp_mul_shortcuts()
1703 MBEDTLS_MPI_CHK( mbedtls_ecp_copy( R, P ) ); in mbedtls_ecp_mul_shortcuts()
1705 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &R->Y, &grp->P, &R->Y ) ); in mbedtls_ecp_mul_shortcuts()
1709 MBEDTLS_MPI_CHK( mbedtls_ecp_mul( grp, R, m, P, NULL, NULL ) ); in mbedtls_ecp_mul_shortcuts()
1732 MBEDTLS_MPI_CHK( mbedtls_ecp_mul_shortcuts( grp, &mP, m, P ) ); in mbedtls_ecp_muladd()
1733 MBEDTLS_MPI_CHK( mbedtls_ecp_mul_shortcuts( grp, R, n, Q ) ); in mbedtls_ecp_muladd()
1735 MBEDTLS_MPI_CHK( ecp_add_mixed( grp, R, &mP, R ) ); in mbedtls_ecp_muladd()
1736 MBEDTLS_MPI_CHK( ecp_normalize_jac( grp, R ) ); in mbedtls_ecp_muladd()
1831 MBEDTLS_MPI_CHK( mbedtls_mpi_fill_random( d, n_size, f_rng, p_rng ) ); in mbedtls_ecp_gen_keypair_base()
1837 MBEDTLS_MPI_CHK( mbedtls_mpi_shift_r( d, b - grp->nbits ) ); in mbedtls_ecp_gen_keypair_base()
1839 MBEDTLS_MPI_CHK( mbedtls_mpi_set_bit( d, grp->nbits, 1 ) ); in mbedtls_ecp_gen_keypair_base()
1842 MBEDTLS_MPI_CHK( mbedtls_mpi_set_bit( d, 0, 0 ) ); in mbedtls_ecp_gen_keypair_base()
1843 MBEDTLS_MPI_CHK( mbedtls_mpi_set_bit( d, 1, 0 ) ); in mbedtls_ecp_gen_keypair_base()
1844 MBEDTLS_MPI_CHK( mbedtls_mpi_set_bit( d, 2, 0 ) ); in mbedtls_ecp_gen_keypair_base()
1864 MBEDTLS_MPI_CHK( f_rng( p_rng, rnd, n_size ) ); in mbedtls_ecp_gen_keypair_base()
1865 MBEDTLS_MPI_CHK( mbedtls_mpi_read_binary( d, rnd, n_size ) ); in mbedtls_ecp_gen_keypair_base()
1866 MBEDTLS_MPI_CHK( mbedtls_mpi_shift_r( d, 8 * n_size - grp->nbits ) ); in mbedtls_ecp_gen_keypair_base()
1944 MBEDTLS_MPI_CHK( mbedtls_ecp_mul( &grp, &Q, &prv->d, &prv->grp.G, NULL, NULL ) ); in mbedtls_ecp_check_pub_priv()
1992 MBEDTLS_MPI_CHK( mbedtls_ecp_group_load( &grp, MBEDTLS_ECP_DP_SECP192R1 ) ); in mbedtls_ecp_self_test()
1994 MBEDTLS_MPI_CHK( mbedtls_ecp_group_load( &grp, mbedtls_ecp_curve_list()->grp_id ) ); in mbedtls_ecp_self_test()
2001 MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &m, 2 ) ); in mbedtls_ecp_self_test()
2002 MBEDTLS_MPI_CHK( mbedtls_ecp_mul( &grp, &P, &m, &grp.G, NULL, NULL ) ); in mbedtls_ecp_self_test()
2007 MBEDTLS_MPI_CHK( mbedtls_mpi_read_string( &m, 16, exponents[0] ) ); in mbedtls_ecp_self_test()
2008 MBEDTLS_MPI_CHK( mbedtls_ecp_mul( &grp, &R, &m, &grp.G, NULL, NULL ) ); in mbedtls_ecp_self_test()
2019 MBEDTLS_MPI_CHK( mbedtls_mpi_read_string( &m, 16, exponents[i] ) ); in mbedtls_ecp_self_test()
2020 MBEDTLS_MPI_CHK( mbedtls_ecp_mul( &grp, &R, &m, &grp.G, NULL, NULL ) ); in mbedtls_ecp_self_test()
2044 MBEDTLS_MPI_CHK( mbedtls_mpi_read_string( &m, 16, exponents[0] ) ); in mbedtls_ecp_self_test()
2045 MBEDTLS_MPI_CHK( mbedtls_ecp_mul( &grp, &R, &m, &P, NULL, NULL ) ); in mbedtls_ecp_self_test()
2056 MBEDTLS_MPI_CHK( mbedtls_mpi_read_string( &m, 16, exponents[i] ) ); in mbedtls_ecp_self_test()
2057 MBEDTLS_MPI_CHK( mbedtls_ecp_mul( &grp, &R, &m, &P, NULL, NULL ) ); in mbedtls_ecp_self_test()