• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /dokuwiki/vendor/phpseclib/phpseclib/phpseclib/Math/

Lines Matching refs:result

102      * $result[self::VALUE] contains the value.
106 * $result[self::SIGN] contains the sign.
598 $result = $this->_int2bytes($this->value[count($this->value) - 1]);
603 $temp->_base256_lshift($result, self::$base);
604 $result = $result | str_pad($temp->_int2bytes($temp->value[$i]), strlen($result), chr(0), STR_PAD_LEFT);
608 str_pad(substr($result, -(($this->precision + 7) >> 3)), ($this->precision + 7) >> 3, chr(0), STR_PAD_LEFT) :
609 $result;
667 $result = $this->precision > 0 ? substr($bits, -$this->precision) : ltrim($bits, '0');
670 return '0' . $result;
673 return $result;
715 $result = '';
718 $result = str_pad(isset($mod->value[0]) ? $mod->value[0] : '', self::$max10Len, '0', STR_PAD_LEFT) . $result;
720 $result = ltrim($result, '0');
721 if (empty($result)) {
722 $result = '0';
726 $result = '-' . $result;
729 return $result;
892 $result = new static();
893 $result->value = $temp[self::VALUE];
894 $result->is_negative = $temp[self::SIGN];
896 return $this->_normalize($result);
1021 $result = new static();
1022 $result->value = $temp[self::VALUE];
1023 $result->is_negative = $temp[self::SIGN];
1025 return $this->_normalize($result);
1230 // doing so would also make the result in one set of unnecessary adds,
1608 $result = array();
1612 $result[$i] = $this->_safe_divide($temp, $divisor);
1613 $carry = (int) ($temp - $divisor * $result[$i]);
1616 return array($result, $carry);
1722 if (openssl_public_encrypt($plaintext, $result, $RSAPublicKey, OPENSSL_NO_PADDING)) {
1723 return new static($result, 256);
1788 $result = $part1->multiply($mod2);
1789 $result = $result->multiply($y1);
1794 $result = $result->add($temp);
1795 list(, $result) = $result->divide($n);
1797 return $this->_normalize($result);
1863 $result = array(1);
1864 $result = $this->_prepareReduce($result, $n_value, $mode);
1868 $result = $this->_squareReduce($result, $n_value, $mode);
1879 $result = $this->_squareReduce($result, $n_value, $mode);
1882 $result = $this->_multiplyReduce($result, $powers[bindec(substr($e_bits, $i, $j + 1))], $n_value, $mode);
1889 $temp->value = $this->_reduce($result, $n_value, $mode);
2107 $result = $this->_subtract($n[self::VALUE], false, $temp[self::VALUE], false);
2109 while ($this->_compare($result[self::VALUE], $result[self::SIGN], $m, false) >= 0) {
2110 $result = $this->_subtract($result[self::VALUE], $result[self::SIGN], $m, false);
2113 return $result[self::VALUE];
2167 $result = array_slice($x, 0, $n_length + 1);
2172 if ($this->_compare($result, false, $temp[self::VALUE], $temp[self::SIGN]) < 0) {
2175 $result = $this->_add($result, false, $corrector_value, false);
2176 $result = $result[self::VALUE];
2180 $result = $this->_subtract($result, false, $temp[self::VALUE], $temp[self::SIGN]);
2181 while ($this->_compare($result[self::VALUE], $result[self::SIGN], $n, false) > 0) {
2182 $result = $this->_subtract($result[self::VALUE], $result[self::SIGN], $n, false);
2185 return $result[self::VALUE];
2227 // doing so would also make the result in one set of unnecessary adds,
2296 $result = array(self::VALUE => $x);
2299 $temp = $result[self::VALUE][$i] * $cache[self::DATA][$key];
2303 $result = $this->_add($result[self::VALUE], false, $temp, false);
2306 $result[self::VALUE] = array_slice($result[self::VALUE], $k);
2308 if ($this->_compare($result, false, $n, false) >= 0) {
2309 $result = $this->_subtract($result[self::VALUE], false, $n, false);
2312 return $result[self::VALUE];
2407 * maximum possible $x is 26 bits and the maximum $result is 16 bits. Thus, we have to be able to handle up to
2420 $result = $x & 0x3; // x**-1 mod 2**2
2421 $result = ($result * (2 - $x * $result)) & 0xF; // x**-1 mod 2**4
2422 $result = ($result * (2 - ($x & 0xFF) * $result)) & 0xFF; // x**-1 mod 2**8
2423 $result = ($result * ((2 - ($x & 0xFFFF) * $result) & 0xFFFF)) & 0xFFFF; // x**-1 mod 2**16
2424 $result = fmod($result * (2 - fmod($x * $result, self::$baseFull)), self::$baseFull); // x**-1 mod 2**26
2425 return $result & self::$maxDigit;
2732 $result = $x_negative ? -1 : 1;
2735 return (count($x_value) > count($y_value)) ? $result : -$result;
2744 return ($x_value[$i] > $y_value[$i]) ? $result : -$result;
2821 $result = $this->copy();
2825 $result->value = array_slice($result->value, 0, $length);
2828 $result->value[$i]&= $x->value[$i];
2831 return $this->_normalize($result);
2863 $result = $this->copy();
2864 $result->value = array_pad($result->value, $length, 0);
2868 $result->value[$i]|= $x->value[$i];
2871 return $this->_normalize($result);
2902 $result = $this->copy();
2903 $result->is_negative = false;
2904 $result->value = array_pad($result->value, $length, 0);
2908 $result->value[$i]^= $x->value[$i];
2911 return $this->_normalize($result);
2924 // (will always result in a smaller number. ie. ~1 isn't 1111 1110 - it's 0)
3070 $result = MATH_BIGINTEGER_MODE != self::MODE_BCMATH ? $left->bitwise_or($right) : $left->add($right);
3071 return $this->_normalize($result);
3560 * @param \phpseclib\Math\BigInteger $result
3565 function _normalize($result)
3567 $result->precision = $this->precision;
3568 $result->bitmask = $this->bitmask;
3573 $flip = gmp_cmp($result->value, gmp_init(0)) < 0;
3575 $result->value = gmp_neg($result->value);
3577 $result->value = gmp_and($result->value, $result->bitmask->value);
3579 $result->value = gmp_neg($result->value);
3583 return $result;
3585 if (!empty($result->bitmask->value)) {
3586 $result->value = bcmod($result->value, $result->bitmask->value);
3589 return $result;
3592 $value = &$result->value;
3595 $result->is_negative = false;
3596 return $result;
3601 if (!empty($result->bitmask->value)) {
3610 return $result;