Skip to content

Commit b071413

Browse files
authored
Merge pull request #378 from libtom/remove-deprecated
Remove deprecated functions
2 parents 7e1c622 + 700a79e commit b071413

23 files changed

+72
-695
lines changed

bn_deprecated.c

Lines changed: 0 additions & 321 deletions
This file was deleted.

bn_mp_fread.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ mp_err mp_fread(mp_int *a, int radix, FILE *stream)
3030
do {
3131
int y;
3232
unsigned pos = (unsigned)(ch - (int)'(');
33-
if (mp_s_rmap_reverse_sz < pos) {
33+
if (MP_RMAP_REVERSE_SIZE < pos) {
3434
break;
3535
}
3636

37-
y = (int)mp_s_rmap_reverse[pos];
37+
y = (int)s_mp_rmap_reverse[pos];
3838

3939
if ((y == 0xff) || (y >= radix)) {
4040
break;

bn_mp_prime_is_prime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ mp_err mp_prime_is_prime(const mp_int *a, int t, mp_bool *result)
5151
}
5252

5353
/* is the input equal to one of the primes in the table? */
54-
for (ix = 0; ix < PRIVATE_MP_PRIME_TAB_SIZE; ix++) {
54+
for (ix = 0; ix < MP_PRIME_TAB_SIZE; ix++) {
5555
if (mp_cmp_d(a, s_mp_prime_tab[ix]) == MP_EQ) {
5656
*result = MP_YES;
5757
return MP_OKAY;
5858
}
5959
}
6060
#ifdef MP_8BIT
6161
/* The search in the loop above was exhaustive in this case */
62-
if ((a->used == 1) && (PRIVATE_MP_PRIME_TAB_SIZE >= 31)) {
62+
if ((a->used == 1) && (MP_PRIME_TAB_SIZE >= 31)) {
6363
return MP_OKAY;
6464
}
6565
#endif

bn_mp_prime_next_prime.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ mp_err mp_prime_next_prime(mp_int *a, int t, int bbs_style)
1313
int x, y, cmp;
1414
mp_err err;
1515
mp_bool res = MP_NO;
16-
mp_digit res_tab[PRIVATE_MP_PRIME_TAB_SIZE], step, kstep;
16+
mp_digit res_tab[MP_PRIME_TAB_SIZE], step, kstep;
1717
mp_int b;
1818

1919
/* force positive */
2020
a->sign = MP_ZPOS;
2121

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

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

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

0 commit comments

Comments
 (0)