Lines Matching refs:x

104     private static function checkInstance(self $x, self $y)  argument
106 if ($x->instanceID != $y->instanceID) {
116 public function equals(self $x) argument
118 static::checkInstance($this, $x);
120 return $this->value == $x->value;
128 public function compare(self $x) argument
130 static::checkInstance($this, $x);
133 $b = $x->value;
146 * @param string $x
149 private static function deg($x) argument
151 $x = ltrim($x, "\0");
152 $xbit = decbin(ord($x[0]));
154 $len = strlen($x);
158 return 8 * strlen($x) - 9 + $xlen;
167 private static function polynomialDivide($x, $y) argument
174 $r = $x;
197 private static function regularPolynomialMultiply($x, $y) argument
199 $precomputed = [ltrim($x, "\0")];
200 $x = strrev(BinaryField::base256ToBase2($x));
202 if (strlen($x) == strlen($y)) {
203 $length = strlen($x);
205 $length = max(strlen($x), strlen($y));
206 $x = str_pad($x, $length, '0');
212 $x = strrev($x);
216 $precomputed[$i] = BinaryField::base2ToBase256($x . str_repeat('0', $i));
236 private static function polynomialMultiply($x, $y) argument
238 if (strlen($x) == strlen($y)) {
239 $length = strlen($x);
241 $length = max(strlen($x), strlen($y));
242 $x = str_pad($x, $length, "\0", STR_PAD_LEFT);
249 … self::subMultiply(str_pad($x, 4, "\0", STR_PAD_LEFT), str_pad($y, 4, "\0", STR_PAD_LEFT)) :
250 self::subMultiply($x, $y);
252 return self::regularPolynomialMultiply($x, $y);
257 $x1 = substr($x, 0, -$m);
258 $x0 = substr($x, -$m);
284 * @param string $x
289 private static function subMultiply($x, $y) argument
291 $x = unpack('N', $x)[1];
294 $x0 = $x & 0x11111111;
295 $x1 = $x & 0x22222222;
296 $x2 = $x & 0x44444444;
297 $x3 = $x & 0x88888888;
322 * @param string $x
326 private static function subAdd2($x, $y) argument
328 $length = max(strlen($x), strlen($y));
329 $x = str_pad($x, $length, "\0", STR_PAD_LEFT);
331 return $x ^ $y;
337 * @param string $x
341 private static function subAdd3($x, $y, $z) argument
343 $length = max(strlen($x), strlen($y), strlen($z));
344 $x = str_pad($x, $length, "\0", STR_PAD_LEFT);
347 return $x ^ $y ^ $z;
361 $x = str_pad($this->value, $length, "\0", STR_PAD_LEFT);
364 return new static($this->instanceID, $x ^ $y);
372 public function subtract(self $x) argument
374 return $this->add($x);
429 public function divide(self $x) argument
431 static::checkInstance($this, $x);
433 $x = $x->modInverse();
434 return $this->multiply($x);
447 $x = str_pad($this->value, strlen(static::$modulo[$this->instanceID]), "\0", STR_PAD_LEFT);
449 return new static($this->instanceID, $x ^ static::$modulo[$this->instanceID]);