replaced mp_set_int with mp_set_long, just in case

This commit is contained in:
czurnieden 2018-05-07 02:37:08 +02:00 committed by Steffen Jaeckel
parent 6ee0829d62
commit 06c8f3ec4e
3 changed files with 9 additions and 9 deletions

View File

@ -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) {

View File

@ -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) {

View File

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