Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: WizardOfMenlo/whir
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: scroll-tech/whir
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 5 commits
  • 6 files changed
  • 2 contributors

Commits on Nov 28, 2024

  1. Merge pull request #1 from WizardOfMenlo/main

    Catch up with upstream.
    yczhangsjtu authored Nov 28, 2024
    Copy the full SHA
    304f992 View commit details

Commits on Dec 2, 2024

  1. Merge pull request #4 from WizardOfMenlo/main

    Keep up with upstream
    yczhangsjtu authored Dec 2, 2024
    Copy the full SHA
    861c7be View commit details

Commits on Dec 5, 2024

  1. add ceno pcs trait (#3)

    - [x] add pcs trait from ceno
    - [x] Adapt whir pcs code according to pcs trait
    chaosma authored Dec 5, 2024
    Copy the full SHA
    a5ce4d1 View commit details

Commits on Dec 24, 2024

  1. Copy the full SHA
    d5d7a95 View commit details

Commits on Feb 13, 2025

  1. Catch up with up stream. (#12)

    Fixed a bug in ntt.
    yczhangsjtu authored Feb 13, 2025
    Copy the full SHA
    324259b View commit details
Showing with 428 additions and 6 deletions.
  1. +168 −2 Cargo.lock
  2. +5 −4 Cargo.toml
  3. +2 −0 rust-toolchain.toml
  4. +69 −0 src/ceno_binding/mod.rs
  5. +182 −0 src/ceno_binding/pcs.rs
  6. +2 −0 src/lib.rs
170 changes: 168 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -27,18 +27,19 @@ nimue-pow = { git = "https://github.com/arkworks-rs/nimue" }
lazy_static = "1.4"
rayon = { version = "1.10.0", optional = true }

goldilocks = { git = "https://github.com/scroll-tech/ceno-Goldilocks" }
thiserror = "1"

[profile.release]
debug = true

[features]
default = ["parallel"]
#default = []
default = ["parallel", "ceno"]
parallel = [
"dep:rayon",
"ark-poly/parallel",
"ark-ff/parallel",
"ark-crypto-primitives/parallel",
]
rayon = ["dep:rayon"]


ceno = []
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "nightly-2024-10-03"
69 changes: 69 additions & 0 deletions src/ceno_binding/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
mod pcs;

use ark_ff::FftField;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use std::fmt::Debug;

#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error(transparent)]
ProofError(#[from] nimue::ProofError),
}

pub trait PolynomialCommitmentScheme<E: FftField>: Clone {
type Param: Clone;
type CommitmentWithData;
type Proof: Clone + CanonicalSerialize + CanonicalDeserialize;
type Poly: Clone;
type Transcript;

fn setup(poly_size: usize) -> Self::Param;

fn commit_and_write(
pp: &Self::Param,
poly: &Self::Poly,
transcript: &mut Self::Transcript,
) -> Result<Self::CommitmentWithData, Error>;

fn batch_commit(
pp: &Self::Param,
polys: &[Self::Poly],
) -> Result<Self::CommitmentWithData, Error>;

fn open(
pp: &Self::Param,
comm: Self::CommitmentWithData,
point: &[E],
eval: &E,
transcript: &mut Self::Transcript,
) -> Result<Self::Proof, Error>;

/// This is a simple version of batch open:
/// 1. Open at one point
/// 2. All the polynomials share the same commitment.
/// 3. The point is already a random point generated by a sum-check.
fn batch_open(
pp: &Self::Param,
polys: &[Self::Poly],
comm: Self::CommitmentWithData,
point: &[E],
evals: &[E],
transcript: &mut Self::Transcript,
) -> Result<Self::Proof, Error>;

fn verify(
vp: &Self::Param,
point: &[E],
eval: &E,
proof: &Self::Proof,
transcript: &Self::Transcript,
) -> Result<(), Error>;

fn batch_verify(
vp: &Self::Param,
point: &[E],
evals: &[E],
proof: &Self::Proof,
transcript: &mut Self::Transcript,
) -> Result<(), Error>;
}
Loading