/** * {@inheritDoc} * @see \Mdanter\Ecc\CurveFpInterface::cmp() */ public function cmp(CurveFpInterface $other) { $math = $this->adapter; $equal = $math->cmp($this->a, $other->getA()) == 0; $equal &= $math->cmp($this->b, $other->getB()) == 0; $equal &= $math->cmp($this->prime, $other->getPrime()) == 0; return $equal ? 0 : 1; }
/** * {@inheritDoc} * @see \Mdanter\Ecc\MathAdapterInterface::getPrimeFieldArithmetic() */ public function getPrimeFieldArithmetic(CurveFpInterface $curve) { return $this->getModularArithmetic($curve->getPrime()); }