From 8ca6cc32b2c789a3149861159ad258f2cb9491e3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:39:39 +0200 Subject: Adding upstream version 2.11.4. Signed-off-by: Daniel Baumann --- .../vendor/Zend/Crypt/Math/BigInteger/Bcmath.php | 226 +++++++++++++++++++++ .../Zend/Crypt/Math/BigInteger/Exception.php | 35 ++++ library/vendor/Zend/Crypt/Math/BigInteger/Gmp.php | 219 ++++++++++++++++++++ .../Zend/Crypt/Math/BigInteger/Interface.php | 51 +++++ 4 files changed, 531 insertions(+) create mode 100644 library/vendor/Zend/Crypt/Math/BigInteger/Bcmath.php create mode 100644 library/vendor/Zend/Crypt/Math/BigInteger/Exception.php create mode 100644 library/vendor/Zend/Crypt/Math/BigInteger/Gmp.php create mode 100644 library/vendor/Zend/Crypt/Math/BigInteger/Interface.php (limited to 'library/vendor/Zend/Crypt/Math/BigInteger') diff --git a/library/vendor/Zend/Crypt/Math/BigInteger/Bcmath.php b/library/vendor/Zend/Crypt/Math/BigInteger/Bcmath.php new file mode 100644 index 0000000..2fb4a67 --- /dev/null +++ b/library/vendor/Zend/Crypt/Math/BigInteger/Bcmath.php @@ -0,0 +1,226 @@ + 0) { + $return = chr(bcmod($operand, 256)) . $return; + $operand = bcdiv($operand, 256); + } + if (ord($return[0]) > 127) { + $return = "\0" . $return; + } + return $return; + } + + /**public function integerToBinary($operand) + { + $return = ''; + while(bccomp($operand, '0')) { + $return .= chr(bcmod($operand, '256')); + $operand = bcdiv($operand, '256'); + } + return $return; + }**/ // Prior version for referenced offset + + /** + * @param string $operand + * @return string + */ + public function hexToDecimal($operand) + { + $return = '0'; + while(strlen($hex)) { + $hex = hexdec(substr($operand, 0, 4)); + $dec = bcadd(bcmul($return, 65536), $hex); + $operand = substr($operand, 4); + } + return $return; + } +} diff --git a/library/vendor/Zend/Crypt/Math/BigInteger/Exception.php b/library/vendor/Zend/Crypt/Math/BigInteger/Exception.php new file mode 100644 index 0000000..c1c865d --- /dev/null +++ b/library/vendor/Zend/Crypt/Math/BigInteger/Exception.php @@ -0,0 +1,35 @@ + '7') { + $bigInt = '00' . $bigInt; + } + $return = pack("H*", $bigInt); + return $return; + } + + /** + * @param string $operand + * @return string + */ + public function hexToDecimal($operand) + { + $return = '0'; + while(strlen($hex)) { + $hex = hexdec(substr($operand, 0, 4)); + $dec = gmp_add(gmp_mul($return, 65536), $hex); + $operand = substr($operand, 4); + } + return $return; + } + +} diff --git a/library/vendor/Zend/Crypt/Math/BigInteger/Interface.php b/library/vendor/Zend/Crypt/Math/BigInteger/Interface.php new file mode 100644 index 0000000..9fa9281 --- /dev/null +++ b/library/vendor/Zend/Crypt/Math/BigInteger/Interface.php @@ -0,0 +1,51 @@ +