Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::schnorr::verify_signature_noir ability to verify every message #6218

Closed
jewelofchaos9 opened this issue Oct 3, 2024 · 0 comments · Fixed by #6226
Closed

std::schnorr::verify_signature_noir ability to verify every message #6218

jewelofchaos9 opened this issue Oct 3, 2024 · 0 comments · Fixed by #6226
Assignees

Comments

@jewelofchaos9
Copy link

Problem

std::schnorr::verify_signature_noir returns true, if public key is valid and this check invalid for every message.

Expected Behavior

Returned false

Bug

use dep::std;
use std::embedded_curve_ops::{EmbeddedCurvePoint};


fn main(
) {
}


#[test]
fn test_main() {
    let public_key: EmbeddedCurvePoint = EmbeddedCurvePoint {x: 1, y: 17631683881184975370165255887551781615748388533673675138860, is_infinite: false};
    let signature: [u8; 64] = [0; 64];
    let message: [u8; _] = [2; 64]; // every message
    let verified = std::schnorr::verify_signature_noir(public_key, signature, message);
    assert(verified);
}

To Reproduce

  1. Create Noir project for program written in bug section.
  2. Run nargo test

Possible fix

else {return false;} after check

Environment

nargo version = 0.35.0 
noirc version = 0.35.0+2a0d211b92d002fa75855d4ba27267f8892dd52c (git version hash: 2a0d211b92d002fa75855d4ba27267f8892dd52c, is dirty: false)
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Oct 3, 2024
@jewelofchaos9 jewelofchaos9 changed the title std::schnorr::verify_signature_noir ability to sign every message std::schnorr::verify_signature_noir ability to verify every message Oct 3, 2024
github-merge-queue bot pushed a commit that referenced this issue Oct 4, 2024
# Description

## Problem\*

Resolves #6218 

## Summary\*
return false when signature is null


## 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.
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants