Skip to content

Commit 9fff429

Browse files
committed
Fixed padding to prevent valid signatures from failing in lnurl-auth verifications
1 parent 819ec67 commit 9fff429

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/BitcoinPHP/BitcoinECDSA/BitcoinECDSA.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,8 +1269,9 @@ public function checkSignaturePoints($pubKey, $R, $S, $hash)
12691269

12701270
$xRes = gmp_strval($resultingPt['x'], 16);
12711271

1272-
while(strlen($xRes) < 64)
1273-
$xRes = '0' . $xRes;
1272+
//while(strlen($xRes) < 64)
1273+
while(strlen($xRes) < strlen($R))
1274+
$xRes = '0' . $xRes;
12741275

12751276
if(strtoupper($xRes) === strtoupper($R))
12761277
return true;

0 commit comments

Comments
 (0)