Closed Bug 59438 Opened 24 years ago Closed 24 years ago

mpp_pprime() says 15 is prime!

Categories

(NSS :: Libraries, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: nelson, Assigned: nelson)

Details

When given any number that is equal to 3 mod 4, mpp_pprime says that number is prime. The bug is simply that "res" is not set to MP_NO prior to the for (jx = 1; jx < b; jx++) loop, and if that loop executes zero times (because b is 1), the result is MP_OK, not MP_NO. Also, HoAC suggests using sequential values of a, rather than random values of a.
mpp_pprime is the Miller Rabin pseudo-primality test. I will check in a fix shortly. I'm also going to do some other cleanup to the code.
Status: NEW → ASSIGNED
I believe this bug is fixed in revision 1.13 of mpprime.c. It passes the new test case I added to mpi-test
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Changed target milestone to show this bug was fixed in NSS 3.1.1
Target Milestone: --- → 3.1.1
You need to log in before you can comment on or make changes to this bug.