sub gen_k { my ($p) = @_; ## XXX choose bitsize based on bitsize of $p my $bits = 198; my $p_minus1 = Math::BigInt->new($p)->bsub(1); my $k = Crypt::OpenPGP::Util::get_random_bigint($bits); while (1) { last if Math::BigInt::bgcd($k, $p_minus1) == 1; $k++; } $k; }
In reply to Re^2: Code hanging with Crypt OpenPGP
by mark_elrod
in thread Code hanging with Crypt OpenPGP
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |