Skip to content

Commit

Permalink
replace gmp_strval
Browse files Browse the repository at this point in the history
  • Loading branch information
andkom committed Nov 16, 2023
1 parent 6407a0a commit a7e1bcd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Taproot.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static public function construct(string $pubKey, string $merkleRoot = ''): strin

$point = Point::fromPubKey($adapter, $curve, $pubKey)->liftX();

$x = hex2bin(gmp_strval($point->getX(), 16));
$x = $adapter->intToString($point->getX());
$tweak = gmp_init(bin2hex(Utils::taggedHash('TapTweak', $x . $merkleRoot)), 16);

if ($adapter->cmp($tweak, $generator->getOrder()) > 0) {
Expand All @@ -37,7 +37,7 @@ static public function construct(string $pubKey, string $merkleRoot = ''): strin

$G = new Point($adapter, $curve, $generator->getX(), $generator->getY());
$Q = $point->add($G->mul($tweak));

return hex2bin(gmp_strval($Q->getX(), 16));
return $adapter->intToString($Q->getX());
}
}

0 comments on commit a7e1bcd

Please sign in to comment.