Commit 06c8f3ec4e328638896c6728cdd027ef9f7a41ca

czurnieden 2018-05-07T02:37:08

replaced mp_set_int with mp_set_long, just in case

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;
       }
    }