diff --git a/src/Taproot.php b/src/Taproot.php index 506349b..f401fb5 100644 --- a/src/Taproot.php +++ b/src/Taproot.php @@ -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) { @@ -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()); } }