Feature #1684
RandomNBitPrime - new fn
Status:
Closed
Priority:
Normal
Assignee:
Category:
New Function
Target version:
Description
Add a new fn RandomNBitPrime(n)
which gives a uniform random prime in the range 2^(n-1)
to 2^n
.
The trouble with RandomSmallPrime
is that it can generate "annoyingly small primes".
History
#1 Updated by John Abbott about 2 years ago
- Status changed from New to Feedback
- Assignee set to John Abbott
- % Done changed from 0 to 90
I have a first version... needed by a student.
A quick test suggests that it works fine. Really I just copied the code for RandomSmallPrime
and made a few changes.
Will check in soon.
#2 Updated by John Abbott almost 2 years ago
- Status changed from Feedback to Closed
- % Done changed from 90 to 100
- Estimated time set to 0.80 h
This was completed about 2 months ago. There is even doc!
Not sure how one could test it: perhaps range check and IsPrime check?
Maybe I'll one...