adapter = $adapter; $this->generator = $generator; $this->secretMultiplier = $secretMultiplier; } /** * {@inheritDoc} * @see \Mdanter\Ecc\Crypto\Key\PrivateKeyInterface::getPublicKey() */ public function getPublicKey() { return new PublicKey($this->adapter, $this->generator, $this->generator->mul($this->secretMultiplier)); } /** * {@inheritDoc} * @see \Mdanter\Ecc\Crypto\Key\PrivateKeyInterface::getPoint() */ public function getPoint() { return $this->generator; } /** * {@inheritDoc} * @see \Mdanter\Ecc\Crypto\Key\PrivateKeyInterface::getCurve() */ public function getCurve() { return $this->generator->getCurve(); } /** * {@inheritDoc} * @see \Mdanter\Ecc\Crypto\Key\PrivateKeyInterface::getSecret() */ public function getSecret() { return $this->secretMultiplier; } /** * {@inheritDoc} * @see \Mdanter\Ecc\Crypto\Key\PrivateKeyInterface::createExchange() */ public function createExchange(MessageFactory $messageFactory, PublicKeyInterface $recipient = null) { $exchange = new EcDH($this->adapter, $messageFactory); $exchange->setSenderKey($this); $exchange->setRecipientKey($recipient); return $exchange; } }