Lines Matching refs:value

191     var $value;  variable in phpseclib\\Math\\BigInteger
339 $this->value = $x;
342 $this->value = gmp_init(0);
345 $this->value = '0';
348 $this->value = array();
366 $this->value = function_exists('gmp_import') ?
370 $this->value = gmp_neg($this->value);
380 … $this->value = bcmul($this->value, '4294967296', 0); // 4294967296 == 2**32
381 …$this->value = bcadd($this->value, 0x1000000 * ord($x[$i]) + ((ord($x[$i + 1]) << 16) | (ord($x[$i…
385 $this->value = '-' . $this->value;
392 … $this->value[] = $this->_bytes2int($this->_base256_rshift($x, self::$base));
401 $this->value = $temp->value;
422 $this->value = gmp_init($temp);
428 $this->value = $this->is_negative ? '-' . $temp->value : $temp->value;
434 $this->value = $temp->value;
439 $this->value = $temp->value;
454 $this->value = gmp_init($x);
459 $this->value = $x === '-' ? '0' : (string) $x;
465 $multiplier->value = array(self::$max10);
479 $this->value = $temp->value;
504 $this->value = $temp->value;
557 if (gmp_cmp($this->value, gmp_init(0)) == 0) {
562 $temp = gmp_export($this->value);
564 $temp = gmp_strval(gmp_abs($this->value), 16);
573 if ($this->value === '0') {
577 $value = '';
578 $current = $this->value;
586 $value = chr($temp >> 16) . chr($temp >> 8) . chr($temp) . $value;
591 … substr(str_pad($value, $this->precision >> 3, chr(0), STR_PAD_LEFT), -($this->precision >> 3)) :
592 ltrim($value, chr(0));
595 if (!count($this->value)) {
598 $result = $this->_int2bytes($this->value[count($this->value) - 1]);
602 for ($i = count($temp->value) - 2; $i >= 0; --$i) {
604 …$result = $result | str_pad($temp->_int2bytes($temp->value[$i]), strlen($result), chr(0), STR_PAD_…
696 return gmp_strval($this->value);
698 if ($this->value === '0') {
702 return ltrim($this->value, '0');
705 if (!count($this->value)) {
714 $divisor->value = array(self::$max10);
716 while (count($temp->value)) {
718 …$result = str_pad(isset($mod->value[0]) ? $mod->value[0] : '', self::$max10Len, '0', STR_PAD_LEFT)…
747 $temp->value = $this->value;
814 $this->value = $temp->value;
880 $temp->value = gmp_add($this->value, $y->value);
885 $temp->value = bcadd($this->value, $y->value, 0);
890 $temp = $this->_add($this->value, $this->is_negative, $y->value, $y->is_negative);
893 $result->value = $temp[self::VALUE];
944 $value = $y_value;
947 $value = $x_value;
950 $value[count($value)] = 0; // just in case the carry adds an extra digit
960 …$value[$i] = (int) ($sum - self::$baseFull * $temp); // eg. a faster alternative to fmod($sum, 0x4…
961 $value[$j] = $temp;
967 $value[$i] = $carry ? $sum - self::$baseFull : $sum;
972 for (; $value[$i] == self::$maxDigit; ++$i) {
973 $value[$i] = 0;
975 ++$value[$i];
979 self::VALUE => $this->_trim($value),
1009 $temp->value = gmp_sub($this->value, $y->value);
1014 $temp->value = bcsub($this->value, $y->value, 0);
1019 $temp = $this->_subtract($this->value, $this->is_negative, $y->value, $y->is_negative);
1022 $result->value = $temp[self::VALUE];
1142 $temp->value = gmp_mul($this->value, $x->value);
1147 $temp->value = bcmul($this->value, $x->value, 0);
1152 $temp = $this->_multiply($this->value, $this->is_negative, $x->value, $x->is_negative);
1155 $product->value = $temp[self::VALUE];
1324 * @param array $value
1328 function _baseSquare($value) argument
1330 if (empty($value)) {
1333 $square_value = $this->_array_repeat(0, 2 * count($value));
1335 for ($i = 0, $max_index = count($value) - 1; $i <= $max_index; ++$i) {
1338 $temp = $square_value[$i2] + $value[$i] * $value[$i];
1344 $temp = $square_value[$k] + 2 * $value[$j] * $value[$i] + $carry;
1363 * @param array $value
1367 function _karatsubaSquare($value) argument
1369 $m = count($value) >> 1;
1372 return $this->_baseSquare($value);
1375 $x1 = array_slice($value, $m);
1376 $x0 = array_slice($value, 0, $m);
1429 list($quotient->value, $remainder->value) = gmp_div_qr($this->value, $y->value);
1431 if (gmp_sign($remainder->value) < 0) {
1432 $remainder->value = gmp_add($remainder->value, gmp_abs($y->value));
1440 $quotient->value = bcdiv($this->value, $y->value, 0);
1441 $remainder->value = bcmod($this->value, $y->value);
1443 if ($remainder->value[0] == '-') {
1444 …$remainder->value = bcadd($remainder->value, $y->value[0] == '-' ? substr($y->value, 1) : $y->valu…
1450 if (count($y->value) == 1) {
1451 list($q, $r) = $this->_divide_digit($this->value, $y->value[0]);
1454 $quotient->value = $q;
1455 $remainder->value = array($r);
1477 $temp->value = array(1);
1491 $msb = $y->value[count($y->value) - 1];
1497 $y_value = &$y->value;
1499 $x_max = count($x->value) - 1;
1500 $y_max = count($y->value) - 1;
1503 $quotient_value = &$quotient->value;
1512 $temp_value = &$temp->value;
1513 $rhs_value = &$rhs->value;
1522 $x_max = count($x->value) - 1;
1526 $x_value = &$x->value;
1549 $lhs->value = array($quotient_value[$q_index]);
1557 $lhs->value = array($quotient_value[$q_index]);
1564 $temp_value = &$temp->value;
1676 $temp->value = gmp_powm($this->value, $e->value, $n->value);
1729 $temp->value = bcpowmod($this->value, $e->value, $n->value, 0);
1734 if (empty($e->value)) {
1736 $temp->value = array(1);
1740 if ($e->value == array(1)) {
1745 if ($e->value == array(2)) {
1747 $temp->value = $this->_square($this->value);
1760 if ($n->value[0] & 1) {
1766 for ($i = 0; $i < count($n->value); ++$i) {
1767 if ($n->value[$i]) {
1768 $temp = decbin($n->value[$i]);
1779 $mod2->value = array(1);
1782 …$part1 = ($mod1->value != array(1)) ? $this->_slidingWindow($e, $mod1, self::MONTGOMERY) : new sta…
1834 $e_value = $e->value;
1848 $n_value = $n->value;
1852 $powers[1] = $this->_prepareReduce($this->value, $n_value, $mode);
1889 $temp->value = $this->_reduce($result, $n_value, $mode);
1915 $lhs->value = $x;
1917 $rhs->value = $n;
1921 $lhs->value = $x;
1923 $rhs->value = $n;
1925 return $temp->value;
2003 $temp->value = array(1);
2044 $lhs->value = $n;
2045 $rhs->value = $m;
2047 return $temp->value;
2062 $lhs_value = &$lhs->value;
2066 $rhs->value = $m;
2069 $u = $u->value;
2070 $m1 = $m1->value;
2140 $lhs->value = $x;
2141 $rhs->value = $n;
2143 return $temp->value;
2150 $lhs_value = &$lhs->value;
2154 $rhs->value = $n;
2156 $cache[self::DATA][] = $temp->value;
2383 $lhs->value = array_merge($this->_array_repeat(0, count($n)), $x);
2385 $rhs->value = $n;
2388 return $temp->value;
2460 $temp->value = gmp_invert($this->value, $n->value);
2462 return ($temp->value === false) ? false : $this->_normalize($temp);
2523 extract(gmp_gcdext($this->value, $n->value));
2535 $u = $this->value;
2536 $v = $n->value;
2569 $g->value = array(1);
2571 while (!(($x->value[0] & 1)|| ($y->value[0] & 1))) {
2585 $a->value = $d->value = $g->value = array(1);
2586 $b->value = $c->value = array();
2588 while (!empty($u->value)) {
2589 while (!($u->value[0] & 1)) {
2591 … if ((!empty($a->value) && ($a->value[0] & 1)) || (!empty($b->value) && ($b->value[0] & 1))) {
2599 while (!($v->value[0] & 1)) {
2601 … if ((!empty($d->value) && ($d->value[0] & 1)) || (!empty($c->value) && ($c->value[0] & 1))) {
2666 $temp->value = gmp_abs($this->value);
2669 … $temp->value = (bccomp($this->value, '0', 0) < 0) ? substr($this->value, 1) : $this->value;
2672 $temp->value = $this->value;
2700 $r = gmp_cmp($this->value, $y->value);
2709 return bccomp($this->value, $y->value, 0);
2712 return $this->_compare($this->value, $this->is_negative, $y->value, $y->is_negative);
2765 return gmp_cmp($this->value, $x->value) == 0;
2767 return $this->value === $x->value && $this->is_negative == $x->is_negative;
2790 $this->value = $temp->value;
2806 $temp->value = gmp_and($this->value, $x->value);
2823 $length = min(count($x->value), count($this->value));
2825 $result->value = array_slice($result->value, 0, $length);
2828 $result->value[$i]&= $x->value[$i];
2847 $temp->value = gmp_or($this->value, $x->value);
2862 $length = max(count($this->value), count($x->value));
2864 $result->value = array_pad($result->value, $length, 0);
2865 $x->value = array_pad($x->value, $length, 0);
2868 $result->value[$i]|= $x->value[$i];
2887 $temp->value = gmp_xor(gmp_abs($this->value), gmp_abs($x->value));
2901 $length = max(count($this->value), count($x->value));
2904 $result->value = array_pad($result->value, $length, 0);
2905 $x->value = array_pad($x->value, $length, 0);
2908 $result->value[$i]^= $x->value[$i];
2975 $temp->value = gmp_div_q($this->value, gmp_pow($two, $shift));
2979 $temp->value = bcdiv($this->value, bcpow('2', $shift, 0), 0);
2984 $temp->value = $this->value;
3013 $temp->value = gmp_mul($this->value, gmp_pow($two, $shift));
3017 $temp->value = bcmul($this->value, bcpow('2', $shift, 0), 0);
3022 $temp->value = $this->value;
3253 $p->value = gmp_nextprime($x->value);
3319 gmp_setbit($this->value, 0);
3322 if ($this->value[strlen($this->value) - 1] % 2 == 0) {
3323 $this->value = bcadd($this->value, '1');
3327 $this->value[0] |= 1;
3371 return gmp_prob_prime($this->value, $t) != 0;
3373 if ($this->value === '2') {
3376 if ($this->value[strlen($this->value) - 1] % 2 == 0) {
3381 if ($this->value == array(2)) {
3384 if (~$this->value[0] & 1) {
3430 $value = $this->value;
3432 list(, $r) = $this->_divide_digit($value, $prime);
3434 return count($value) == 1 && $value[0] == $prime;
3444 $r_value = $r->value;
3449 while ($r->value[strlen($r->value) - 1] % 2 == 0) {
3450 $r->value = bcdiv($r->value, '2', 0);
3506 for ($i = 0; $i < count($this->value); ++$i) {
3507 $temp = $this->value[$i] * $shift + $carry;
3509 $this->value[$i] = (int) ($temp - $carry * self::$baseFull);
3513 $this->value[count($this->value)] = $carry;
3517 array_unshift($this->value, 0);
3541 $this->value = array_slice($this->value, $num_digits);
3546 for ($i = count($this->value) - 1; $i >= 0; --$i) {
3547 $temp = $this->value[$i] >> $shift | $carry;
3548 $carry = ($this->value[$i] & $carry_mask) << $carry_shift;
3549 $this->value[$i] = $temp;
3552 $this->value = $this->_trim($this->value);
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);
3585 if (!empty($result->bitmask->value)) {
3586 $result->value = bcmod($result->value, $result->bitmask->value);
3592 $value = &$result->value;
3594 if (!count($value)) {
3599 $value = $this->_trim($value);
3601 if (!empty($result->bitmask->value)) {
3602 $length = min(count($value), count($this->bitmask->value));
3603 $value = array_slice($value, 0, $length);
3606 $value[$i] = $value[$i] & $this->bitmask->value[$i];
3618 * @param array $value
3622 function _trim($value) argument
3624 for ($i = count($value) - 1; $i >= 0; --$i) {
3625 if ($value[$i]) {
3628 unset($value[$i]);
3631 return $value;