Home | History | Annotate | Download | only in mtest

Lines Matching refs:RADIX

39   function.  Since a number n in radix r takes up about log_r(n)
104 /* Value to digit maps for radix conversion */
2231 stream 'ofp'. Output is generated using the internal radix.
2448 /* {{{ mp_read_radix(mp, str, radix) */
2451 mp_read_radix(mp, str, radix)
2459 mp_err mp_read_radix(mp_int *mp, unsigned char *str, int radix)
2465 ARGCHK(mp != NULL && str != NULL && radix >= 2 && radix <= MAX_RADIX,
2472 (s_mp_tovalue(str[ix], radix) < 0) &&
2486 while((val = s_mp_tovalue(str[ix], radix)) >= 0) {
2487 if((res = s_mp_mul_d(mp, radix)) != MP_OKAY)
2505 /* {{{ mp_radix_size(mp, radix) */
2507 int mp_radix_size(mp_int *mp, int radix)
2512 len = s_mp_outlen(mp_count_bits(mp), radix) + 1; /* for NUL terminator */
2523 /* {{{ mp_value_radix_size(num, qty, radix) */
2527 radix = target base
2529 Return the number of digits in the specified radix that would be
2532 int mp_value_radix_size(int num, int qty, int radix)
2534 ARGCHK(num >= 0 && qty > 0 && radix >= 2 && radix <= MAX_RADIX, 0);
2536 return s_mp_outlen(num * qty, radix);
2542 /* {{{ mp_toradix(mp, str, radix) */
2544 mp_err mp_toradix(mp_int *mp, unsigned char *str, int radix)
2549 ARGCHK(radix > 1 && radix <= MAX_RADIX, MP_RANGE);
2558 mp_digit rem, rdx = (mp_digit)radix;
2575 ch = s_mp_todigit(rem, radix, 0);
2812 alternative to multiplication by powers of the radix
2888 /* Divide by two -- take advantage of radix properties to do it fast */
3051 leading digit of b to be at least half the radix, which we
3057 at least half the radix. By choosing a power of 2, we simplify the
3065 while(t < (RADIX / 2)) {
3130 w = (RADIX + dp[0]) - d;
3136 w = (RADIX + dp[ix]) - b;
3338 w = (RADIX + *pa) - w - *pb++;
3345 w = RADIX + *pa - w;
3689 /* The guess can be as much as RADIX + 1 */
3690 if(q >= RADIX)
3691 q = RADIX - 1;
3894 Convert the given character to its digit value, in the given radix.
3895 If the given character is not understood in the given radix, -1 is
3898 The results will be odd if you use a radix < 2 or > 62, you are
3935 Convert val to a radix-r digit, if possible. If val is out of range
3937 the value in the given radix.
3939 The results may be odd if you use a radix < 2 or > 64, you are
3961 /* {{{ s_mp_outlen(bits, radix) */
3964 Return an estimate for how long a string is needed to hold a radix