curve = $generator->getCurve(); $this->generator = $generator; $this->point = $point; $this->adapter = $adapter; $n = $generator->getOrder(); if ($n == null) { throw new \LogicException("Generator must have order."); } if (! $point->mul($n)->isInfinity()) { throw new \RuntimeException("Generator point order is bad."); } if ($adapter->cmp($point->getX(), 0) < 0 || $adapter->cmp($n, $point->getX()) <= 0 || $adapter->cmp($point->getY(), 0) < 0 || $adapter->cmp($n, $point->getY()) <= 0 ) { throw new \RuntimeException("Generator point has x and y out of range."); } } /** * {@inheritDoc} * @see \Mdanter\Ecc\Crypto\Key\PublicKeyInterface::getCurve() */ public function getCurve() { return $this->curve; } /** * {$inheritDoc} * @see \Mdanter\Ecc\Crypto\Key\PublicKeyInterface::getGenerator() */ public function getGenerator() { return $this->generator; } /** * {@inheritDoc} * @see \Mdanter\Ecc\Crypto\Key\PublicKeyInterface::getPoint() */ public function getPoint() { return $this->point; } }