Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
321 changes: 0 additions & 321 deletions bn_deprecated.c

This file was deleted.

4 changes: 2 additions & 2 deletions bn_mp_fread.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ mp_err mp_fread(mp_int *a, int radix, FILE *stream)
do {
int y;
unsigned pos = (unsigned)(ch - (int)'(');
if (mp_s_rmap_reverse_sz < pos) {
if (MP_RMAP_REVERSE_SIZE < pos) {
break;
}

y = (int)mp_s_rmap_reverse[pos];
y = (int)s_mp_rmap_reverse[pos];

if ((y == 0xff) || (y >= radix)) {
break;
Expand Down
4 changes: 2 additions & 2 deletions bn_mp_prime_is_prime.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ mp_err mp_prime_is_prime(const mp_int *a, int t, mp_bool *result)
}

/* is the input equal to one of the primes in the table? */
for (ix = 0; ix < PRIVATE_MP_PRIME_TAB_SIZE; ix++) {
for (ix = 0; ix < MP_PRIME_TAB_SIZE; ix++) {
if (mp_cmp_d(a, s_mp_prime_tab[ix]) == MP_EQ) {
*result = MP_YES;
return MP_OKAY;
}
}
#ifdef MP_8BIT
/* The search in the loop above was exhaustive in this case */
if ((a->used == 1) && (PRIVATE_MP_PRIME_TAB_SIZE >= 31)) {
if ((a->used == 1) && (MP_PRIME_TAB_SIZE >= 31)) {
return MP_OKAY;
}
#endif
Expand Down
10 changes: 5 additions & 5 deletions bn_mp_prime_next_prime.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ mp_err mp_prime_next_prime(mp_int *a, int t, int bbs_style)
int x, y, cmp;
mp_err err;
mp_bool res = MP_NO;
mp_digit res_tab[PRIVATE_MP_PRIME_TAB_SIZE], step, kstep;
mp_digit res_tab[MP_PRIME_TAB_SIZE], step, kstep;
mp_int b;

/* force positive */
a->sign = MP_ZPOS;

/* simple algo if a is less than the largest prime in the table */
if (mp_cmp_d(a, s_mp_prime_tab[PRIVATE_MP_PRIME_TAB_SIZE-1]) == MP_LT) {
if (mp_cmp_d(a, s_mp_prime_tab[MP_PRIME_TAB_SIZE-1]) == MP_LT) {
/* find which prime it is bigger than "a" */
for (x = 0; x < PRIVATE_MP_PRIME_TAB_SIZE; x++) {
for (x = 0; x < MP_PRIME_TAB_SIZE; x++) {
cmp = mp_cmp_d(a, s_mp_prime_tab[x]);
if (cmp == MP_EQ) {
continue;
Expand Down Expand Up @@ -66,7 +66,7 @@ mp_err mp_prime_next_prime(mp_int *a, int t, int bbs_style)
}

/* generate the restable */
for (x = 1; x < PRIVATE_MP_PRIME_TAB_SIZE; x++) {
for (x = 1; x < MP_PRIME_TAB_SIZE; x++) {
if ((err = mp_mod_d(a, s_mp_prime_tab[x], res_tab + x)) != MP_OKAY) {
return err;
}
Expand All @@ -88,7 +88,7 @@ mp_err mp_prime_next_prime(mp_int *a, int t, int bbs_style)
step += kstep;

/* compute the new residue without using division */
for (x = 1; x < PRIVATE_MP_PRIME_TAB_SIZE; x++) {
for (x = 1; x < MP_PRIME_TAB_SIZE; x++) {
/* add the step to each residue */
res_tab[x] += kstep;

Expand Down
Loading