libcrypt-dh-gmp-perl

Crypt::dh replacement that uses gmp directly
  https://metacpan.org/release/Crypt-DH-GMP
  0
  no reviews



Crypt::dh::gmp is a (somewhat) portable replacement to crypt::dh, implemented mostly in c.

in the beginning, there was crypt::dh. however, crypt::dh suffers from a couple of problems: gmp/pari libraries are almost always required; crypt::dh additionally has math::bigint in between gmp. instantiating an object comes with a relatively high cost, and if you make many computations in one go, your program will suffer dramatically because of this.

crypt::dh::gmp attempts to alleviate these problems by providing a crypt::dh-compatible layer, which, instead of doing calculations via math::bigint, directly works with libgmp in c.

this means that essentially 2 call stacks worth of expensive perl method calls are eliminated and also only load 1 (crypt::dh::gmp) module instead of 3 (crypt::dh + math::bigint + math::bigint::gmp) is needed.

these add up to a fairly significant increase in performance.