Lines Matching refs:mp_digit
73 typedef unsigned long mp_digit; typedef
79 typedef unsigned long mp_digit; typedef
92 #define MP_MASK ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1))
128 mp_digit *dp;
156 static void mp_set(mp_int * a, mp_digit b);
193 static int mp_mul_d (mp_int * a, mp_digit b, mp_int * c);
250 register mp_digit u, *tmpa, *tmpb, *tmpc; in s_mp_add()
271 u = *tmpc >> ((mp_digit)DIGIT_BIT); in s_mp_add()
286 u = *tmpc >> ((mp_digit)DIGIT_BIT); in s_mp_add()
326 register mp_digit u, *tmpa, *tmpb, *tmpc; in s_mp_sub()
345 u = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof (mp_digit) - 1)); in s_mp_sub()
357 u = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof (mp_digit) - 1)); in s_mp_sub()
380 a->dp = OPT_CAST(mp_digit) XMALLOC (sizeof (mp_digit) * MP_PREC); in mp_init()
708 static int mp_cmp_d(mp_int * a, mp_digit b) in mp_cmp_d()
930 mp_digit *tmpa, *tmpb; in mp_cmp_mag()
1027 mp_digit D, r, rr; in mp_div_2d()
1065 D = (mp_digit) (b % DIGIT_BIT); in mp_div_2d()
1067 register mp_digit *tmpc, mask, shift; in mp_div_2d()
1070 mask = (((mp_digit)1) << D) - 1; in mp_div_2d()
1116 mp_digit *tmp; in mp_zero()
1147 register mp_digit *tmpa, *tmpb; in mp_copy()
1192 register mp_digit *bottom, *top; in mp_rshd()
1267 mp_digit *tmp; in mp_grow()
1280 tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * size); in mp_grow()
1325 static void mp_set (mp_int * a, mp_digit b) in mp_set()
1349 register mp_digit r, rr, *tmpa, *tmpb; in mp_div_2()
1386 mp_digit d; in mp_mul_2d()
1410 d = (mp_digit) (b % DIGIT_BIT); in mp_mul_2d()
1412 register mp_digit *tmpc, shift, mask, r, rr; in mp_mul_2d()
1416 mask = (((mp_digit)1) << d) - 1; in mp_mul_2d()
1519 register mp_digit *top, *bottom; in mp_lshd()
1552 mp_digit q; in mp_count_bits()
1564 while (q > ((mp_digit) 0)) { in mp_count_bits()
1566 q >>= ((mp_digit) 1); in mp_count_bits()
1600 (mp_digit) ((((mp_digit) 1) << (((mp_digit) b) % DIGIT_BIT)) - ((mp_digit) 1)); in mp_mod_2d()
1781 q.dp[i - t - 1] = ((((mp_digit)1) << DIGIT_BIT) - 1); in mp_div()
1789 q.dp[i - t - 1] = (mp_digit) (tmp & (mp_word) (MP_MASK)); in mp_div()
1886 mp_digit buf; in s_mp_exptmod()
2019 y = (buf >> (mp_digit)(DIGIT_BIT - 1)) & 1; in s_mp_exptmod()
2020 buf <<= (mp_digit)1; in s_mp_exptmod()
2234 a->dp[b / DIGIT_BIT] = ((mp_digit)1) << (b % DIGIT_BIT); in mp_2expt()
2272 if (((unsigned long) um) > (((mp_digit)1) << (DIGIT_BIT - 1))) { in mp_reduce()
2345 mp_digit u; in s_mp_mul_digs()
2347 mp_digit tmpx, *tmpt, *tmpy; in s_mp_mul_digs()
2390 *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK)); in s_mp_mul_digs()
2393 u = (mp_digit) (r >> ((mp_word) DIGIT_BIT)); in s_mp_mul_digs()
2429 mp_digit W[MP_WARRAY]; in fast_s_mp_mul_digs()
2447 mp_digit *tmpx, *tmpy; in fast_s_mp_mul_digs()
2469 W[ix] = ((mp_digit)_W) & MP_MASK; in fast_s_mp_mul_digs()
2480 register mp_digit *tmpc; in fast_s_mp_mul_digs()
2507 a->dp = OPT_CAST(mp_digit) XMALLOC (sizeof (mp_digit) * size); in mp_init_size()
2532 mp_digit u, tmpx, *tmpt; in s_mp_sqr()
2549 t.dp[ix+ix] = (mp_digit) (r & ((mp_word) MP_MASK)); in s_mp_sqr()
2552 u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); in s_mp_sqr()
2570 *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK)); in s_mp_sqr()
2573 u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); in s_mp_sqr()
2576 while (u != ((mp_digit) 0)) { in s_mp_sqr()
2578 *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK)); in s_mp_sqr()
2579 u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); in s_mp_sqr()
2597 mp_digit u; in s_mp_mul_high_digs()
2599 mp_digit tmpx, *tmpt, *tmpy; in s_mp_mul_high_digs()
2636 *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK)); in s_mp_mul_high_digs()
2639 u = (mp_digit) (r >> ((mp_word) DIGIT_BIT)); in s_mp_mul_high_digs()
2653 mp_montgomery_setup (mp_int * n, mp_digit * rho) in mp_montgomery_setup()
2655 mp_digit x, b; in mp_montgomery_setup()
2700 static int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) in fast_mp_montgomery_reduce()
2720 register mp_digit *tmpx; in fast_mp_montgomery_reduce()
2749 register mp_digit mu; in fast_mp_montgomery_reduce()
2750 mu = (mp_digit) (((W[ix] & MP_MASK) * rho) & MP_MASK); in fast_mp_montgomery_reduce()
2768 register mp_digit *tmpn; in fast_mp_montgomery_reduce()
2792 register mp_digit *tmpx; in fast_mp_montgomery_reduce()
2821 *tmpx++ = (mp_digit)(*_W++ & ((mp_word) MP_MASK)); in fast_mp_montgomery_reduce()
2862 register mp_digit r, rr, *tmpa, *tmpb; in mp_mul_2()
2877 rr = *tmpa >> ((mp_digit)(DIGIT_BIT - 1)); in mp_mul_2()
2880 *tmpb++ = ((*tmpa++ << ((mp_digit)1)) | r) & MP_MASK; in mp_mul_2()
2962 mp_digit buf, mp; in mp_exptmod_fast()
2969 int (*redux)(mp_int*,mp_int*,mp_digit); in mp_exptmod_fast()
3141 y = (mp_digit)(buf >> (DIGIT_BIT - 1)) & 1; in mp_exptmod_fast()
3142 buf <<= (mp_digit)1; in mp_exptmod_fast()
3260 mp_digit W[MP_WARRAY], *tmpx; in fast_s_mp_sqr()
3276 mp_digit *tmpy; in fast_s_mp_sqr()
3314 W[ix] = (mp_digit)(_W & MP_MASK); in fast_s_mp_sqr()
3325 mp_digit *tmpb; in fast_s_mp_sqr()
3345 mp_mul_d (mp_int * a, mp_digit b, mp_int * c) in mp_mul_d()
3347 mp_digit u, *tmpa, *tmpc; in mp_mul_d()
3379 *tmpc++ = (mp_digit) (r & ((mp_word) MP_MASK)); in mp_mul_d()
3382 u = (mp_digit) (r >> ((mp_word) DIGIT_BIT)); in mp_mul_d()