removed obsolete code

This commit is contained in:
czurnieden 2019-06-12 01:58:03 +02:00 committed by Steffen Jaeckel
parent aa4864eec4
commit 1803417e03
2 changed files with 5 additions and 20 deletions

View File

@ -145,7 +145,6 @@ mp_err mp_prime_is_prime(const mp_int *a, int t, mp_bool *result)
TODO: can be made a bit finer grained but comparing is not free.
*/
if (t < 0) {
t = -t;
/*
Sorenson, Jonathan; Webster, Jonathan (2015).
"Strong Pseudoprimes to Twelve Prime Bases".

View File

@ -177,26 +177,12 @@ mp_err mp_prime_strong_lucas_selfridge(const mp_int *a, mp_bool *result)
mp_set(&U2mz, 1uL); /* U_1 */
mp_set(&V2mz, (mp_digit)P); /* V_1 */
if (Q < 0) {
Q = -Q;
mp_set_u32(&Qmz, (uint32_t)Q);
if ((err = mp_mul_2(&Qmz, &Q2mz)) != MP_OKAY) {
goto LBL_LS_ERR;
}
/* Initializes calculation of Q^d */
mp_set_u32(&Qkdz, (uint32_t)Q);
Qmz.sign = MP_NEG;
Q2mz.sign = MP_NEG;
Qkdz.sign = MP_NEG;
Q = -Q;
} else {
mp_set_u32(&Qmz, (uint32_t)Q);
if ((err = mp_mul_2(&Qmz, &Q2mz)) != MP_OKAY) {
goto LBL_LS_ERR;
}
/* Initializes calculation of Q^d */
mp_set_u32(&Qkdz, (uint32_t)Q);
mp_set_i32(&Qmz, Q);
if ((err = mp_mul_2(&Qmz, &Q2mz)) != MP_OKAY) {
goto LBL_LS_ERR;
}
/* Initializes calculation of Q^d */
mp_set_i32(&Qkdz, Q);
Nbits = mp_count_bits(&Dz);