The following heat map shows how many seconds Math_BigInteger takes to perform encryption / decryption with a 2048-bit RSA key on an Intel Core i5-3320M CPU @ 2.6GHz under various environments. benchmark.phps was used to generate the heatmap. col*.php are all variations of speed.phps.
Math_BigInteger automatically picks the fastest settings to use depending on what extensions it has available at its disposal.
|w/o OpenSSL||w/ OpenSSL|
The major limiting factor for the internal implementation is the PHP engine itself. Each successive major version brings with it speed improvements but there's only so much it can do.
GMP, to quote wikipedia, "aims to be faster than any other bignum library", using "highly optimized assembly language code".
Only used for powMod(). Converts the exponent and the modulo to an appropriately formatted RSA public key and performs non-padded RSA encryption with that.