From e4325aace424d5c4552c92cdb360974fdd294048 Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Thu, 10 Oct 2024 14:38:43 +0100 Subject: [PATCH] fix: address inactive public key check in `verify_signature_noir` (#6270) # Description ## Problem\* Resolves #6266 ## Summary\* This PR adds the fix specified in #6266, thanks to @jewelofchaos9 for raising this issue :pray: ## Additional Context ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --- noir_stdlib/src/schnorr.nr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noir_stdlib/src/schnorr.nr b/noir_stdlib/src/schnorr.nr index 0623f116dea..76db04400e2 100644 --- a/noir_stdlib/src/schnorr.nr +++ b/noir_stdlib/src/schnorr.nr @@ -37,7 +37,7 @@ pub fn verify_signature_noir( if ((sig_s.lo != 0) | (sig_s.hi != 0)) & ((sig_e.lo != 0) | (sig_e.hi != 0)) { let (r_is_infinite, result) = calculate_signature_challenge(public_key, sig_s, sig_e, message); - is_ok = !r_is_infinite; + is_ok &= !r_is_infinite; for i in 0..32 { is_ok &= result[i] == signature[32 + i]; }