From e2f0d0fea4a8145acb8cf87bc1e82fa102e7ffe7 Mon Sep 17 00:00:00 2001 From: Uncle Stretch Date: Fri, 11 Sep 2026 15:29:29 +0300 Subject: [PATCH] select verification path based on px coordinate Signed-off-by: Uncle Stretch --- src/libraries/Verifier.sol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libraries/Verifier.sol b/src/libraries/Verifier.sol index b34e247..d48c241 100644 --- a/src/libraries/Verifier.sol +++ b/src/libraries/Verifier.sol @@ -21,7 +21,7 @@ library Verifier { uint256 s ) internal view returns (bool) { if (px >= P || rx >= P || s >= N || s == 0) { return false; } - if (rx < N) { return verifySpectre(call, px, rx, s); } + if (px < N) { return verifySpectre(call, px, rx, s); } return verifyBanshee(call, px, rx, s); } @@ -38,6 +38,8 @@ library Verifier { // Explanation: https://hackmd.io/@nZ-twauPRISEa6G9zg3XRw/SyjJzSLt9 bytes32 sp = bytes32(N - mulmod(s, px, N)); bytes32 ep = bytes32(N - mulmod(e, px, N)); + if (sp == 0) { return false; } + if (ep == 0) { return false; } // Parity should be always even address recoveredR = ecrecover(sp, 27, bytes32(px), ep);