Simplify Nova witness blind API - #513
Conversation
Require callers to provide a cryptographic RNG when extracting an R1CS instance and witness, while keeping blind sampling internal.
There was a problem hiding this comment.
🟡 Changes recommended
The new API removes the explicit-blind pathway and changes the existing method signature in a way that appears to conflict with the direction described in issue #511, leaving deterministic/replayable callers without a direct explicit-blind option.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates Nova’s R1CS witness-extraction flow to make witness blinding come from a caller-supplied RNG, and adjusts internal call sites/tests accordingly.
Changes:
- Changes the
NovaWitness::r1cs_instance_and_witnessAPI to acceptrng: &mut Rand wiresOsRngthrough existing call sites. - Updates
R1CSWitness::newto sample its blinding factor from a provided RNG (and updates determinism tests to use seeded RNGs). - Bumps crate version to
0.76.0.
File summaries
| File | Description |
|---|---|
| src/spartan/direct.rs | Passes &mut OsRng into witness extraction during direct proving. |
| src/r1cs/mod.rs | Switches witness blinding to RNG-based sampling; updates determinism test accordingly. |
| src/nova/nifs.rs | Updates tests/bench paths to supply &mut OsRng for witness extraction/construction. |
| src/nova/mod.rs | Threads &mut OsRng into base-case witness extraction. |
| src/nova/circuit/mod.rs | Updates circuit tests to pass &mut OsRng into witness extraction. |
| src/neutron/relation.rs | Updates test to pass &mut OsRng into witness extraction. |
| src/neutron/nifs.rs | Updates tests/bench paths to pass &mut OsRng into witness extraction/construction. |
| src/neutron/mod.rs | Threads &mut OsRng into witness extraction in the main Neutron flow. |
| src/neutron/circuit/mod.rs | Updates circuit tests to pass &mut OsRng into witness extraction. |
| src/gadgets/ecc.rs | Updates gadget tests to pass &mut OsRng into witness extraction. |
| src/frontend/r1cs.rs | Changes the NovaWitness trait method signature to require an RNG and removes the explicit-blind path. |
| src/frontend/mod.rs | Updates frontend tests to pass &mut OsRng into witness extraction. |
| Cargo.toml | Version bump to 0.76.0. |
Review details
- Files reviewed: 13/13 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Wilson Nguyen (MercysJest)
left a comment
There was a problem hiding this comment.
LGTM!
Abhiram Kothapalli (abhiramkothapalli)
left a comment
There was a problem hiding this comment.
LGTM!
Closes #511