Example #1
0
 private function diffieHellman($publicKeyPoints, $privateKey)
 {
     $ecdsa = new BitcoinECDSA();
     $normalizedPublicKey = ['x' => '0x' . $publicKeyPoints['x'], 'y' => '0x' . $publicKeyPoints['y']];
     $product = $ecdsa->mulPoint($privateKey, $normalizedPublicKey);
     $secretPoints = ['x' => gmp_strval($product['x'], 16), 'y' => gmp_strval($product['y'], 16)];
     return $secretPoints;
 }