The default bug view has changed. See this FAQ.

mpp_pprime() says 15 is prime!

RESOLVED FIXED in 3.1.1

Status

NSS
Libraries
P3
critical
RESOLVED FIXED
17 years ago
17 years ago

People

(Reporter: Nelson Bolyard (seldom reads bugmail), Assigned: Nelson Bolyard (seldom reads bugmail))

Tracking

Firefox Tracking Flags

(Not tracked)

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.
(Assignee)

Comment 1

17 years ago
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
(Assignee)

Comment 2

17 years ago
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
Last Resolved: 17 years ago
Resolution: --- → FIXED
(Assignee)

Comment 3

17 years ago
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.