Skip to content

Simplify Nova witness blind API - #513

Merged
Srinath Setty (srinathsetty) merged 2 commits into
mainfrom
simplify-novawitness-blind-api
Sep 3, 2026
Merged

Srinath Setty (srinathsetty) merged 2 commits into
mainfrom
simplify-novawitness-blind-api

Conversation

@srinathsetty

Copy link
Copy Markdown
Collaborator

Closes #511

Require callers to provide a cryptographic RNG when extracting an R1CS instance and witness, while keeping blind sampling internal.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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_witness API to accept rng: &mut R and wires OsRng through existing call sites.
  • Updates R1CSWitness::new to 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.

Comment thread src/frontend/r1cs.rs
Comment thread src/r1cs/mod.rs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@srinathsetty
Srinath Setty (srinathsetty) added this pull request to the merge queue Sep 3, 2026
Merged via the queue into main with commit 98576ef Sep 3, 2026
14 checks passed

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@srinathsetty
Srinath Setty (srinathsetty) deleted the simplify-novawitness-blind-api branch September 3, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add RNG-taking R1CS witness extraction API

5 participants