Lines Matching defs:radix

2569 /* modified diminished radix reduction */
3047 int mp_fread(mp_int *a, int radix, FILE *stream)
3064 /* find y in the radix map */
3065 for (y = 0; y < radix; y++) {
3070 if (y == radix) {
3075 if ((err = mp_mul_d(a, radix, a)) != MP_OKAY) {
3117 int mp_fwrite(mp_int *a, int radix, FILE *stream)
3122 if ((err = mp_radix_size(a, radix, &len)) != MP_OKAY) {
3131 if ((err = mp_toradix(a, buf, radix)) != MP_OKAY) {
4115 * Let B represent the radix [e.g. 2**DIGIT_BIT] and
6213 int mp_radix_size (mp_int * a, int radix, int *size)
6222 if (radix == 2) {
6227 /* make sure the radix is in range */
6228 if (radix < 2 || radix > 64) {
6255 if ((res = mp_div_d (&t, (mp_digit) radix, &t, &d)) != MP_OKAY) {
6294 /* chars used in radix conversions */
6381 /* read a string [ASCII] in a given radix */
6382 int mp_read_radix (mp_int * a, const char *str, int radix)
6390 /* make sure the radix is ok */
6391 if (radix < 2 || radix > 64) {
6410 /* if the radix < 36 the conversion is case insensitive
6414 ch = (char) ((radix < 36) ? toupper (*str) : *str);
6422 * and is less than the given radix add it
6425 if (y < radix) {
6426 if ((res = mp_mul_d (a, (mp_digit) radix, a)) != MP_OKAY) {
8356 /* stores a bignum as a ASCII string in a given radix (2..64) */
8357 int mp_toradix (mp_int * a, char *str, int radix)
8364 /* check range of the radix */
8365 if (radix < 2 || radix > 64) {
8389 if ((res = mp_div_d (&t, (mp_digit) radix, &t, &d)) != MP_OKAY) {
8435 /* stores a bignum as a ASCII string in a given radix (2..64)
8439 int mp_toradix_n(mp_int * a, char *str, int radix, int maxlen)
8446 /* check range of the maxlen, radix */
8447 if (maxlen < 2 || radix < 2 || radix > 64) {
8481 if ((res = mp_div_d (&t, (mp_digit) radix, &t, &d)) != MP_OKAY) {
8719 /* reverse an array, used for radix code */