From 9573195d2a45e7e0558270bf8a6cea99dc62a1c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B0=8F=E6=98=8E?= <2966980@qq.com> Date: Fri, 10 Mar 2023 18:51:09 +0800 Subject: [PATCH] Fix: casting error Fixing error "Object of class GMP could not be converted to bool" during multiple call --- Signature.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Signature.class.php b/Signature.class.php index 57e32e9..d80384d 100644 --- a/Signature.class.php +++ b/Signature.class.php @@ -255,7 +255,7 @@ public static function recoverPublicKey($R, $S, $hash, $recoveryFlags){ // Precalculate (p + 1) / 4 where p is the field order // $p_over_four is GMP static $p_over_four; // XXX just assuming only one curve/prime will be used - if (!$p_over_four) { + if (null === $p_over_four) { $p_over_four = gmp_div(gmp_add($p, 1), 4); } @@ -412,4 +412,4 @@ public static function checkDerSignature($pubKey, $signature, $hash) } -?> \ No newline at end of file +?>