Alt-Crypt-RSA-BigInt
view release on metacpan or search on metacpan
Changes.old view on Meta::CPAN
* "use base" instead of @ISA
* "use FindBin" instead of the literal "lib" - this is safer.
1.58 Dec 21, 2006
* We turn on binmode() on filehandles when reading and writing
keys from disk, so allow safe exchange of SSH private keys
from Windows and *nix systems. Thanks to Ulisses Gomes
<ulisses@ibiz.com.br> for pointing this out.
* Include a copy of the GPL in the distribution. This addresses
bug #18771. (http://rt.cpan.org/Public/Bug/Display.html?id=18771)
* Removed warnings from t/15-benchmark.t
1.57 Oct 20, 2005
* Updated POD documentation and added POD syntax and coverage
inc/Devel/CheckLib.pm view on Meta::CPAN
@$ld
);
} elsif($Config{cc} =~ /bcc32(\.exe)?/) { # Borland
@sys_cmd = (
@$cc,
@$ld,
(map { "-I$_" } @incpaths),
"-o$exefile",
$cfile
);
} else { # Unix-ish: gcc, Sun, AIX (gcc, cc), ...
@sys_cmd = (
@$cc,
@$ld,
$cfile,
(map { "-I$_" } @incpaths),
"-o", "$exefile"
);
}
warn "# @sys_cmd\n" if $args{debug};
my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd);
inc/Devel/CheckLib.pm view on Meta::CPAN
} elsif($Config{cc} eq 'CC/DECC') { # VMS
} elsif($Config{cc} =~ /bcc32(\.exe)?/) { # Borland
@sys_cmd = (
@$cc,
@$ld,
"-o$exefile",
(map { "-I$_" } @incpaths),
(map { "-L$_" } @libpaths),
"-l$lib",
$cfile);
} else { # Unix-ish
# gcc, Sun, AIX (gcc, cc)
@sys_cmd = (
@$cc,
@$ld,
$cfile,
"-o", "$exefile",
(map { "-I$_" } @incpaths),
(map { "-L$_" } @libpaths),
"-l$lib",
);
lib/Crypt/RSA/Key.pm view on Meta::CPAN
return $self->error ("Odd keysize.") if
$params{Size} % 2;
my $size = int($params{Size}/2);
my $verbosity = $params{Verbosity} || 0;
# Switch from Maurer prime to nbit prime, then add some more primality
# testing. This is faster and gives us a wider set of possible primes.
# We really ought to consider the distribution. See:
# https://crocs.fi.muni.cz/_media/public/papers/usenixsec16_1mrsakeys_trfimu_201603.pdf
# for comments on p/q selection.
while (1) {
my $p = random_nbit_prime($size);
my $q = random_nbit_prime($size);
$p = Math::BigInt->new("$p") unless ref($p) eq 'Math::BigInt';
$q = Math::BigInt->new("$q") unless ref($q) eq 'Math::BigInt';
# For unbiased rejection sampling, generate both p/q if size too small.
next unless bitsize($p * $q) == $params{Size};
( run in 0.707 second using v1.01-cache-2.11-cpan-39bf76dae61 )