From 0cbb6318527893233e6b82ff27e306b7370f3638 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Fri, 18 Apr 2014 23:43:03 -0500 Subject: [PATCH] BigInteger: explain precense of uncallable code --- phpseclib/Math/BigInteger.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index be1f948f..51eac0de 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -1721,6 +1721,11 @@ class Math_BigInteger return $this->_normalize($this->_slidingWindow($e, $n, MATH_BIGINTEGER_BARRETT)); + // the following code, although not callable, can be run independently of the above code + // although the above code performed better in my benchmarks the following could might + // perform better under different circumstances. in lieu of deleting it it's just been + // made uncallable + // is the modulo odd? if ( $n->value[0] & 1 ) { return $this->_normalize($this->_slidingWindow($e, $n, MATH_BIGINTEGER_MONTGOMERY)); @@ -2294,6 +2299,11 @@ class Math_BigInteger $temp = $this->_multiply($x, false, $y, false); return $this->_montgomery($temp[MATH_BIGINTEGER_VALUE], $m); + // the following code, although not callable, can be run independently of the above code + // although the above code performed better in my benchmarks the following could might + // perform better under different circumstances. in lieu of deleting it it's just been + // made uncallable + static $cache = array( MATH_BIGINTEGER_VARIABLE => array(), MATH_BIGINTEGER_DATA => array()