Lines Matching refs:y

104     private static function checkInstance(self $x, self $y)  argument
106 if ($x->instanceID != $y->instanceID) {
167 private static function polynomialDivide($x, $y) argument
173 $d = static::deg($y);
182 $s = static::polynomialMultiply($s, $y);
197 private static function regularPolynomialMultiply($x, $y) argument
201 $y = strrev(BinaryField::base256ToBase2($y));
202 if (strlen($x) == strlen($y)) {
205 $length = max(strlen($x), strlen($y));
207 $y = str_pad($y, $length, '0');
218 for ($i = 0; $i < strlen($y); $i++) {
219 if ($y[$i] == '1') {
236 private static function polynomialMultiply($x, $y) argument
238 if (strlen($x) == strlen($y)) {
241 $length = max(strlen($x), strlen($y));
243 $y = str_pad($y, $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);
259 $y1 = substr($y, 0, -$m);
260 $y0 = substr($y, -$m);
285 * @param string $y
289 private static function subMultiply($x, $y) argument
292 $y = unpack('N', $y)[1];
299 $y0 = $y & 0x11111111;
300 $y1 = $y & 0x22222222;
301 $y2 = $y & 0x44444444;
302 $y3 = $y & 0x88888888;
323 * @param string $y
326 private static function subAdd2($x, $y) argument
328 $length = max(strlen($x), strlen($y));
330 $y = str_pad($y, $length, "\0", STR_PAD_LEFT);
331 return $x ^ $y;
338 * @param string $y
341 private static function subAdd3($x, $y, $z) argument
343 $length = max(strlen($x), strlen($y), strlen($z));
345 $y = str_pad($y, $length, "\0", STR_PAD_LEFT);
347 return $x ^ $y ^ $z;
355 public function add(self $y) argument
357 static::checkInstance($this, $y);
362 $y = str_pad($y->value, $length, "\0", STR_PAD_LEFT);
364 return new static($this->instanceID, $x ^ $y);
382 public function multiply(self $y) argument
384 static::checkInstance($this, $y);
386 return new static($this->instanceID, static::polynomialMultiply($this->value, $y->value));