Crypt::DSA::GMP::Util - DSA Utility functions
use Crypt::DSA::GMP::Util qw( func1 func2 ... );
Crypt::DSA::GMP::Util contains a set of exportable utility functions used through the Crypt::DSA::GMP module.
Returns the number of bits in the integer $n.
Given a string $string of any length, treats the string as a base-256 representation of an integer, and returns that integer.
Given an integer $int (maybe a Math::BigInt object), returns an octet string representation (e.g. a string where each byte is a base-256 digit of the integer).
Computes $a ^ $exp mod $n and returns the value.
Computes the multiplicative inverse of $a mod $n and returns the value.
Returns $n random bytes from the entropy source. The entropy source is a Crypt::Random::Seed source.
An optional boolean second argument indicates whether the data is being used for key generation, hence the best possible randomness is used. If this argument is not present or is false, then the best non-blocking source will be used.
$n = makerandom(Size => 512);
Takes a Size argument and creates a random Math::BigInt with exactly that number of bits using data from "randombytes". The high order bit will always be set.
Also takes an optional KeyGen argument that is given to "randombytes".
$n = makerandomrange(Max => $max); # 0 <= $n <= $max
Returns a Math::BigInt uniformly randomly selected between 0 and $max. Random data is provided by "randombytes".
See Crypt::DSA::GMP for author, copyright, and license information.
To install Crypt::DSA::GMP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Crypt::DSA::GMP
CPAN shell
perl -MCPAN -e shell install Crypt::DSA::GMP
For more information on module installation, please visit the detailed CPAN module installation guide.