My perl instances seems to be using Math::BigInt::GMP
#/opt/perl/bin/perl -E 'use Crypt::RSA::Key; my($pari,$big) = ($Math:: +Pari::VERSION, $Math::BigInt::VERSION); my $lib = Math::BigInt->confi +g()->{lib} if $big; printf "Using %s\n", $pari ? "Pari $pari" : $big +? "BigInt with $lib" : "???";' Using BigInt with Math::BigInt::GMP
However, when run the following using an RSA public key
my $ct = $pgp->encrypt( Filename => 'plain.txt', Recipients => $key, C +ipher => 'DES3' ) or die "Encryption failed: ", $pgp->errstr;
I see Pari library being opened.
#truss ./encrypt_openpgp.pl 2>&1 | grep open | grep Pari open64("/opt/perl-5.26.0/lib/site_perl/5.26.0/sun4-solaris-thread-mult +i/Math/Pari.pm", O_RDONLY) = 4 open("/opt/perl-5.26.0/lib/site_perl/5.26.0/sun4-solaris-thread-multi/ +auto/Math/Pari/Pari.so", O_RDONLY) = 4
And when I see my code hanging it always has this file open: /opt/perl-5.26.0/lib/site_perl/5.26.0/Crypt/Random.pm

If I remove Math::Pari he program fails with
./encrypt_openpgp.pl No random source available! at /opt/perl-5.26.0/lib/site_perl/5.26.0/C +rypt/OpenPGP/Util.pm line 111.
sub get_random_bytes { 103 my $length = shift; 104 if (eval 'require Crypt::Random; 1;') { 105 return Crypt::Random::makerandom_octet( Length => +$length); 106 } 107 elsif (eval 'require Bytes::Random::Secure; 1;') { 108 return Bytes::Random::Secure::random_bytes($length +); 109 } 110 else { 111 die "No random source available!"; 112 } 113 }

In reply to Re^2: Crypt::RSA without Pari by roperl
in thread Crypt::RSA without Pari by roperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.