replaced mp_set_int with mp_set_long, just in case
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
diff --git a/bn_mp_mul_si.c b/bn_mp_mul_si.c
index 61dee53..4fc17be 100644
--- a/bn_mp_mul_si.c
+++ b/bn_mp_mul_si.c
@@ -31,7 +31,7 @@ int mp_mul_si(const mp_int *a, long d, mp_int *c)
// mp_digit might be smaller than a long, which excludes
// the use of mp_mul_d() here.
- if ((err = mp_set_int(&t, (unsigned long) d)) != MP_OKAY) {
+ if ((err = mp_set_long(&t, (unsigned long) d)) != MP_OKAY) {
goto LBL_MPMULSI_ERR;
}
if ((err = mp_mul(a, &t, c)) != MP_OKAY) {
diff --git a/bn_mp_prime_frobenius_underwood.c b/bn_mp_prime_frobenius_underwood.c
index 3454bc2..bf92205 100644
--- a/bn_mp_prime_frobenius_underwood.c
+++ b/bn_mp_prime_frobenius_underwood.c
@@ -48,7 +48,7 @@ int mp_prime_frobenius_underwood(const mp_int *N, int *result)
continue;
}
// (32764^2 - 4) < 2^31, no bigint for >MP_8BIT needed)
- if ((e = mp_set_int(&T1z,(unsigned long)a)) != MP_OKAY) {
+ if ((e = mp_set_long(&T1z,(unsigned long)a)) != MP_OKAY) {
goto LBL_FU_ERR;
}
@@ -78,7 +78,7 @@ int mp_prime_frobenius_underwood(const mp_int *N, int *result)
goto LBL_FU_ERR;
}
// Composite if N and (a+4)*(2*a+5) are not coprime
- if ((e = mp_set_int(&T1z, (unsigned long)((a+4)*(2*a+5)))) != MP_OKAY) {
+ if ((e = mp_set_long(&T1z, (unsigned long)((a+4)*(2*a+5)))) != MP_OKAY) {
goto LBL_FU_ERR;
}
@@ -167,7 +167,7 @@ int mp_prime_frobenius_underwood(const mp_int *N, int *result)
}
}
- if ((e = mp_set_int(&T1z, (unsigned long)(2 * a + 5))) != MP_OKAY) {
+ if ((e = mp_set_long(&T1z, (unsigned long)(2 * a + 5))) != MP_OKAY) {
goto LBL_FU_ERR;
}
if ((e = mp_mod(&T1z,N,&T1z)) != MP_OKAY) {
diff --git a/bn_mp_prime_strong_lucas_selfridge.c b/bn_mp_prime_strong_lucas_selfridge.c
index 5de8d5c..e11ef7f 100644
--- a/bn_mp_prime_strong_lucas_selfridge.c
+++ b/bn_mp_prime_strong_lucas_selfridge.c
@@ -63,7 +63,7 @@ int mp_prime_strong_lucas_selfridge(const mp_int *a, int *result)
for (;;) {
Ds = sign * D;
sign = -sign;
- if ((e = mp_set_int(&Dz,(unsigned long) D)) != MP_OKAY) {
+ if ((e = mp_set_long(&Dz,(unsigned long) D)) != MP_OKAY) {
goto LBL_LS_ERR;
}
if ((e = mp_gcd(a, &Dz, &gcd)) != MP_OKAY) {
@@ -155,14 +155,14 @@ int mp_prime_strong_lucas_selfridge(const mp_int *a, int *result)
if (Q < 0) {
Q = -Q;
- if ((e = mp_set_int(&Qmz, (unsigned long) Q)) != MP_OKAY) {
+ if ((e = mp_set_long(&Qmz, (unsigned long) Q)) != MP_OKAY) {
goto LBL_LS_ERR;
}
if ((e = mp_mul_2(&Qmz, &Q2mz)) != MP_OKAY) {
goto LBL_LS_ERR;
}
/* Initializes calculation of Q^d */
- if ((e = mp_set_int(&Qkdz, (unsigned long) Q)) != MP_OKAY) {
+ if ((e = mp_set_long(&Qkdz, (unsigned long) Q)) != MP_OKAY) {
goto LBL_LS_ERR;
}
Qmz.sign = MP_NEG;
@@ -170,14 +170,14 @@ int mp_prime_strong_lucas_selfridge(const mp_int *a, int *result)
Qkdz.sign = MP_NEG;
Q = -Q;
} else {
- if ((e = mp_set_int(&Qmz, (unsigned long) Q)) != MP_OKAY) {
+ if ((e = mp_set_long(&Qmz, (unsigned long) Q)) != MP_OKAY) {
goto LBL_LS_ERR;
}
if ((e = mp_mul_2(&Qmz, &Q2mz)) != MP_OKAY) {
goto LBL_LS_ERR;
}
/* Initializes calculation of Q^d */
- if ((e = mp_set_int(&Qkdz, (unsigned long) Q)) != MP_OKAY) {
+ if ((e = mp_set_long(&Qkdz, (unsigned long) Q)) != MP_OKAY) {
goto LBL_LS_ERR;
}
}