Skip to content

Commit a7e1bcd

Browse files
committed
replace gmp_strval
1 parent 6407a0a commit a7e1bcd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Taproot.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static public function construct(string $pubKey, string $merkleRoot = ''): strin
2828

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

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

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

3838
$G = new Point($adapter, $curve, $generator->getX(), $generator->getY());
3939
$Q = $point->add($G->mul($tweak));
40-
41-
return hex2bin(gmp_strval($Q->getX(), 16));
40+
41+
return $adapter->intToString($Q->getX());
4242
}
4343
}

0 commit comments

Comments
 (0)