private function getSharedSecret($userPublicKey)
    {
        $userPublicKeyPoint = $this->serializer->unserialize($this->curve, bin2hex($userPublicKey));
        $userPublicKeyObject = $this->generator->getPublicKeyFrom(
            $userPublicKeyPoint->getX(),
            $userPublicKeyPoint->getY(),
            $this->generator->getOrder()
        );

        $point = $userPublicKeyObject->getPoint()->mul($this->privateKey->getSecret())->getX();

        return hex2bin($this->adapter->decHex((string) $point));
    }
private function getSharedSecret($userPublicKey)
    {
        $userPublicKeyPoint = $this->serializer->unserialize($this->curve, bin2hex($userPublicKey));
        $userPublicKeyObject = $this->generator->getPublicKeyFrom(
            $userPublicKeyPoint->getX(),
            $userPublicKeyPoint->getY(),
            $this->generator->getOrder()
        );

        $point = $userPublicKeyObject->getPoint()->mul($this->privateKey->getSecret())->getX();

        return hex2bin($this->adapter->decHex((string) $point));
    }
private function getSharedSecret ( $ userPublicKey ) { $ userPublicKeyPoint = $ this -> serializer -> unserialize ( $ this -> curve , bin2hex ( $ userPublicKey ) ) ; $ userPublicKeyObject = $ this -> generator -> getPublicKeyFrom ( $ userPublicKeyPoint -> getX ( ) , $ userPublicKeyPoint -> getY ( ) , $ this -> generator -> getOrder ( ) ) ; $ point = $ userPublicKeyObject -> getPoint ( ) -> mul ( $ this -> privateKey -> getSecret ( ) ) -> getX ( ) ; return hex2bin ( $ this -> adapter -> decHex ( ( string ) $ point ) ) ; }
Get shared secret from user public key and server private key.

@param string $userPublicKey

@return string
Get shared secret from user public key and server private key .