Lines Matching refs:mp_digit
133 void s_mp_setz(mp_digit *dp, mp_size count); /* zero digits */
134 void s_mp_copy(mp_digit *sp, mp_digit *dp, mp_size count); /* copy */
146 #define s_mp_setz(dp, count) memset(dp, 0, (count) * sizeof(mp_digit))
153 #define s_mp_copy(sp, dp, count) memcpy(dp, sp, (count) * sizeof(mp_digit))
169 void s_mp_div_2d(mp_int *mp, mp_digit d); /* divide by 2^d in place */
170 void s_mp_mod_2d(mp_int *mp, mp_digit d); /* modulo 2^d in place */
171 mp_err s_mp_mul_2d(mp_int *mp, mp_digit d); /* multiply by 2^d in place*/
174 mp_digit s_mp_norm(mp_int *a, mp_int *b); /* normalize for division */
175 mp_err s_mp_add_d(mp_int *mp, mp_digit d); /* unsigned digit addition */
176 mp_err s_mp_sub_d(mp_int *mp, mp_digit d); /* unsigned digit subtract */
177 mp_err s_mp_mul_d(mp_int *mp, mp_digit d); /* unsigned digit multiply */
178 mp_err s_mp_div_d(mp_int *mp, mp_digit d, mp_digit *r);
186 void s_mp_kmul(mp_digit *a, mp_digit *b, mp_digit *out, mp_size len);
195 mp_err s_mp_2expt(mp_int *a, mp_digit k); /* a = 2^k */
197 int s_mp_cmp_d(mp_int *a, mp_digit d); /* magnitude digit compare */
199 int s_mp_ispow2d(mp_digit d); /* is d a power of 2? */
284 if((DIGITS(mp) = s_mp_alloc(prec, sizeof(mp_digit))) == NULL) in mp_init_size()
314 if((DIGITS(mp) = s_mp_alloc(USED(from), sizeof(mp_digit))) == NULL) in mp_init_copy()
346 mp_digit *tmp; in mp_copy()
360 if((tmp = s_mp_alloc(USED(from), sizeof(mp_digit))) == NULL) in mp_copy()
478 void mp_set(mp_int *mp, mp_digit d) in mp_set()
510 (mp_digit)((v >> (ix * CHAR_BIT)) & UCHAR_MAX)); in mp_set_int()
537 mp_err mp_add_d(mp_int *a, mp_digit d, mp_int *b) in mp_add_d()
571 mp_err mp_sub_d(mp_int *a, mp_digit d, mp_int *b) in mp_sub_d()
613 mp_err mp_mul_d(mp_int *a, mp_digit d, mp_int *b) in mp_mul_d()
662 mp_err mp_div_d(mp_int *a, mp_digit d, mp_int *q, mp_digit *r) in mp_div_d()
665 mp_digit rem; in mp_div_d()
675 mp_digit mask; in mp_div_d()
758 mp_err mp_expt_d(mp_int *a, mp_digit d, mp_int *c) in mp_expt_d()
1089 mp_err mp_mul_2d(mp_int *a, mp_digit d, mp_int *c) in mp_mul_2d()
1227 mp_err mp_div_2d(mp_int *a, mp_digit d, mp_int *q, mp_int *r) in mp_div_2d()
1266 mp_digit d; in mp_expt()
1335 mp_err mp_2expt(mp_int *a, mp_digit k) in mp_2expt()
1413 mp_err mp_mod_d(mp_int *a, mp_digit d, mp_digit *c) in mp_mod_d()
1416 mp_digit rem; in mp_mod_d()
1638 mp_digit d, *db = DIGITS(b); in mp_exptmod()
1721 mp_err mp_exptmod_d(mp_int *a, mp_digit d, mp_int *m, mp_int *c) in mp_exptmod_d()
1797 int mp_cmp_d(mp_int *a, mp_digit d) in mp_cmp_d()
2346 mp_digit topdig; in mp_unsigned_bin_size()
2355 count = (USED(mp) - 1) * sizeof(mp_digit); in mp_unsigned_bin_size()
2373 mp_digit *dp, *end, d; in mp_to_unsigned_bin()
2393 for(ix = 0; ix < sizeof(mp_digit); ++ix) { in mp_to_unsigned_bin()
2430 mp_digit d; in mp_count_bits()
2558 mp_digit rem, rdx = (mp_digit)radix; in mp_toradix()
2657 mp_digit *tmp; in s_mp_grow()
2662 if((tmp = s_mp_alloc(min, sizeof(mp_digit))) == NULL) in s_mp_grow()
2707 void s_mp_setz(mp_digit *dp, mp_size count) in s_mp_setz()
2715 memset(dp, 0, count * sizeof(mp_digit)); in s_mp_setz()
2727 void s_mp_copy(mp_digit *sp, mp_digit *dp, mp_size count) in s_mp_copy()
2735 memcpy(dp, sp, count * sizeof(mp_digit)); in s_mp_copy()
2776 mp_digit *zp = DIGITS(mp) + du - 1; in s_mp_clamp()
2819 mp_digit *dp; in s_mp_lshd()
2856 mp_digit *dp; in s_mp_rshd()
2902 mp_digit kin = 0, kout, *dp = DIGITS(mp); in s_mp_mul_2()
2938 void s_mp_mod_2d(mp_int *mp, mp_digit d) in s_mp_mod_2d()
2942 mp_digit dmask, *dp = DIGITS(mp); in s_mp_mod_2d()
2968 mp_err s_mp_mul_2d(mp_int *mp, mp_digit d) in s_mp_mul_2d()
2971 mp_digit save, next, mask, *dp; in s_mp_mul_2d()
3021 void s_mp_div_2d(mp_int *mp, mp_digit d) in s_mp_div_2d()
3024 mp_digit save, next, mask, *dp = DIGITS(mp); in s_mp_div_2d()
3060 mp_digit s_mp_norm(mp_int *a, mp_int *b) in s_mp_norm()
3062 mp_digit t, d = 0; in s_mp_norm()
3088 mp_err s_mp_add_d(mp_int *mp, mp_digit d) /* unsigned digit addition */ in s_mp_add_d()
3092 mp_digit *dp = DIGITS(mp); in s_mp_add_d()
3123 mp_err s_mp_sub_d(mp_int *mp, mp_digit d) /* unsigned digit subtract */ in s_mp_sub_d()
3127 mp_digit *dp = DIGITS(mp); in s_mp_sub_d()
3158 mp_err s_mp_mul_d(mp_int *a, mp_digit d) in s_mp_mul_d()
3163 mp_digit *dp = DIGITS(a); in s_mp_mul_d()
3212 mp_err s_mp_div_d(mp_int *mp, mp_digit d, mp_digit *r) in s_mp_div_d()
3217 mp_digit *dp = DIGITS(mp), *qp; in s_mp_div_d()
3268 mp_digit *pa, *pb; in s_mp_add()
3325 mp_digit *pa, *pb; in s_mp_sub()
3382 s_mp_mod_2d(x, (mp_digit)(DIGIT_BIT * (um + 1))); in s_mp_reduce()
3387 s_mp_mod_2d(&q, (mp_digit)(DIGIT_BIT * (um + 1))); in s_mp_reduce()
3429 mp_digit *pa, *pb, *pt, *pbt; in s_mp_mul()
3474 void s_mp_kmul(mp_digit *a, mp_digit *b, mp_digit *out, mp_size len)
3478 mp_digit *pa, *pt;
3517 mp_digit *pa1, *pa2, *pt, *pbt; in s_mp_sqr()
3631 mp_digit d; in s_mp_div()
3640 s_mp_div_2d(a, (mp_digit)ix); in s_mp_div()
3641 s_mp_mod_2d(b, (mp_digit)ix); in s_mp_div()
3749 mp_err s_mp_2expt(mp_int *a, mp_digit k) in s_mp_2expt()
3789 mp_digit *ap = DIGITS(a) + ix, *bp = DIGITS(b) + ix; in s_mp_cmp()
3810 int s_mp_cmp_d(mp_int *a, mp_digit d) in s_mp_cmp_d()
3813 mp_digit *ap = DIGITS(a); in s_mp_cmp_d()
3837 mp_digit d, *dp; in s_mp_ispow2()
3870 int s_mp_ispow2d(mp_digit d) in s_mp_ispow2d()