Exemplo n.º 1
0
 /**
  * @param PrivateKeyInterface $privateKey
  * @param int|string $integer
  * @return \BitWasp\Bitcoin\Key\PrivateKey
  * @throws \Exception
  */
 public function privateKeyAdd(PrivateKeyInterface $privateKey, $integer)
 {
     $privKey = $privateKey->getBuffer()->getBinary();
     // mod by reference
     $ret = (bool) \secp256k1_ec_privkey_tweak_add($privKey, $this->getBinaryScalar($integer));
     if ($ret === false) {
         throw new \Exception('Secp256k1 privkey tweak add: failed');
     }
     return $this->getRelatedPrivateKey($privateKey, $privKey);
 }