Dana Jacobsen > Math-Prime-Util-0.37 > Math::Prime::Util::RandomPrimes

Download:
Math-Prime-Util-0.37.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.37   Source   Latest Release: Math-Prime-Util-0.44_001

NAME ^

Math::Prime::Util::RandomPrimes - Generate random primes

VERSION ^

Version 0.37

SYNOPSIS ^

DESCRIPTION ^

Routines to generate random primes, including constructing proven primes.

RANDOM UTILITY FUNCTIONS ^

get_randf

Gets a subroutine that will produce random integers between 0 and n, inclusive. The argument n can be a bigint.

get_randf_nbit

Gets a subroutine that will produce random integers between 0 and 2^n-1, inclusive.

RANDOM PRIME FUNCTIONS ^

random_prime

Generate a random prime between low and high. If given one argument, low will be 2.

random_ndigit_prime

Generate a random prime with n digits. n must be at least 1.

random_nbit_prime

Generate a random prime with n bits. n must be at least 2.

random_maurer_prime

Construct a random provable prime of n bits using Maurer's FastPrime algorithm. n must be at least 2.

random_maurer_prime_with_cert

Construct a random provable prime of n bits using Maurer's FastPrime algorithm. n must be at least 2. Returns a list of two items: the prime and the certificate.

random_strong_prime

Construct a random strong prime of n bits. n must be at least 128.

random_proven_prime

Generate or construct a random provable prime of n bits. n must be at least 2.

random_proven_prime_with_cert

Generate or construct a random provable prime of n bits. n must be at least 2. Returns a list of two items: the prime and the certificate.

RANDOM PRIMALITY FUNCTIONS ^

miller_rabin_random

Given a number n and a number of tests to perform k, this does k Miller-Rabin tests on n using randomly selected bases. The return value is 1 if all bases are a witness to to n, or 0 if any of them fail.

SEE ALSO ^

Math::Prime::Util

AUTHORS ^

Dana Jacobsen <dana@acm.org>

COPYRIGHT ^

Copyright 2012-2013 by Dana Jacobsen <dana@acm.org>

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: