GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Math::ProvablePrime(3) User Contributed Perl Documentation Math::ProvablePrime(3)

Math::ProvablePrime - Generate a provable prime number, in pure Perl

    #The returned prime will be 512 bits long
    #(i.e., the first and last bits will be 1)
    #and will be an instance of Math::BigInt.
    #
    my $prime = Math::ProvablePrime::find(512);

There’s not much more to say: this module returns a prime number of a specified bit length.

The specific algorithm is Maurer’s algorithm. The logic in this module is ported from a Python implementation first posted at <http://s13.zetaboards.com/Crypto/topic/7234475/1/>.

This module will be deprecated once Math::Prime::Util is installable without a compiler. (There is pure-Perl logic in that distribution; the install logic just needs to be tweaked.) Math::Prime::Util is faster and has a maintainer who understands the mathematics behind all of this much better than I do.

Math::ProvablePrime is too slow for its intended purpose (i.e., to provide pure-Perl primes), and really, I don’t have the mathematical background that would justify its continued maintenance.

If you have any objection, please let me know.

This module is too slow for practical use. If Math::BigInt::GMP or Math::BigInt::Pari is available, then this module will use one of those backends to achieve reasonable speed. It’ll still be pretty slow, though.

This module is released under the same license as Perl.
2018-08-25 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.