Attempt to clarify code to reduce confusion about side effect of

MP_CHECKOK macro.


git-svn-id: svn://10.0.0.236/trunk@84085 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nelsonb%netscape.com
2000-12-27 03:14:28 +00:00
parent 77b578ec4e
commit e9d4a7ee0b

View File

@@ -341,16 +341,15 @@ mp_err mpp_pprime(mp_int *a, int nt)
for (jx = 1; jx < b; jx++) {
/* z = z^2 (mod a) */
MP_CHECKOK( mp_sqrmod(&z, a, &z) );
res = MP_NO; /* previous line set res to MP_YES */
if(mp_cmp_d(&z, 1) == 0) {
res = MP_NO;
break;
}
if(mp_cmp(&z, &amo) == 0) {
res = MP_YES;
break;
}
res = MP_NO;
} /* end testing loop */
/* If the test passes, we will continue iterating, but a failed