Skip to content

Commit

Permalink
ElGamal: key's p can be a large integer, use Bigint
Browse files Browse the repository at this point in the history
Fixes btrott#30
  • Loading branch information
gozer authored and timlegge committed Sep 29, 2024
1 parent f3f20a0 commit 4221098
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Crypt/OpenPGP/Key/Public/ElGamal.pm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ sub gen_k {
my($p) = @_;
## XXX choose bitsize based on bitsize of $p
my $bits = 198;
my $p_minus1 = $p - 1;
my $p_minus1 = Math::BigInt->new($p) - 1;

my $k = Crypt::OpenPGP::Util::get_random_bigint($bits);
while (1) {
Expand Down

0 comments on commit 4221098

Please sign in to comment.