The following heat map shows how many seconds Math_BigInteger takes to perform encryption / decryption with a 2048-bit RSA key on a 1.73GHz Intel Core i7-820QM under various environments. See speed.phps for the source code.
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.