Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/target
/Cargo.lock
.vscode
.DS_Store
.DS_Store
.claude/
40 changes: 14 additions & 26 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,30 @@ include = ["Cargo.toml", "src", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
edition = "2021"

[dependencies]
ark-crypto-primitives = { version = "0.5.0", features = [
ark-crypto-primitives = { version = "0.6.0", features = [
"merkle_tree",
"crh",
"r1cs",
"constraints",
"sponge",
"blake3",
] }
ark-ff = "0.5.0"
ark-poly = "0.5.0"
ark-r1cs-std = "0.5.0"
ark-relations = "0.5.0"
ark-serialize = "0.5.0"
ark-std = "0.5.0"
ark-ff = "0.6.0"
ark-poly = "0.6.0"
ark-r1cs-std = "0.6.0"
ark-relations = "0.6.0"
ark-serialize = "0.6.0"
ark-std = "0.6.0"
blake3 = "1.5.0"
serde = { version = "1.0.0", features = ["derive"] }
serde_json = "1.0"
spongefish = { git = "https://github.com/z-tech/spongefish.git", branch = "smallfp-support", features = [
"ark-ff",
] }
efficient-sumcheck = { git = "https://github.com/compsec-epfl/efficient-sumcheck.git" }
spongefish = { version = "0.7.0", features = ["ark-ff"] }
effsc = { git = "https://github.com/compsec-epfl/efficient-sumcheck.git" }
thiserror = "2.0.16"
ark-codes = { git = "https://github.com/dmpierre/ark-codes.git" }


[patch.crates-io]
ark-crypto-primitives = { git = "https://github.com/benbencik/crypto-primitives.git", branch = "smallfp-absorb-trait" }
ark-ff = { git = "https://github.com/arkworks-rs/algebra.git" }
ark-poly = { git = "https://github.com/arkworks-rs/algebra.git" }
ark-serialize = { git = "https://github.com/arkworks-rs/algebra.git" }

# resolve transitive pull of spongefish from efficient-sumcheck
[patch."https://github.com/arkworks-rs/spongefish"]
spongefish = { git = "https://github.com/z-tech/spongefish.git", branch = "smallfp-support" }
ark-codes = { git = "https://github.com/z-tech/ark-codes.git", branch = "z-tech/arkworks-0.6.0" }

[dev-dependencies]
ark-bls12-381 = "0.5.0"
ark-bn254 = "0.5.0"
ark-bls12-381 = "0.6.0"
ark-bn254 = "0.6.0"
criterion = "0.8"

[features]
Expand Down
2 changes: 1 addition & 1 deletion benches/utils/domainsep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ use spongefish::ProverState;

pub fn init_prover_state() -> ProverState {
let domainsep = spongefish::domain_separator!("warp::rs");
domainsep.instance(&0u32).std_prover()
domainsep.without_session().instance(&0u32).std_prover()
}
12 changes: 6 additions & 6 deletions src/crypto/merkle/blake3.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use super::parameters::MerkleTreeParams;
use ark_crypto_primitives::crh::blake3::fields::Blake3F;
use ark_crypto_primitives::crh::blake3::Blake3;
use ark_crypto_primitives::crh::blake3::GenericDigest;
use ark_crypto_primitives::crh::blake3::{Blake3CRH, Blake3TwoToOneCRH};
use ark_crypto_primitives::crh::ByteDigest;
use ark_crypto_primitives::{
crh::{CRHScheme, TwoToOneCRHScheme},
merkle_tree::{Config as MerkleConfig, IdentityDigestConverter},
Expand All @@ -15,13 +14,14 @@ pub struct Blake3MerkleConfig<F: PrimeField> {
_field: PhantomData<F>,
}

pub type Blake3MerkleTreeParams<F> = MerkleTreeParams<F, Blake3F<F>, Blake3, GenericDigest<32>>;
pub type Blake3MerkleTreeParams<F> =
MerkleTreeParams<F, Blake3CRH<F>, Blake3TwoToOneCRH, ByteDigest<32>>;

impl<F: PrimeField + Absorb> MerkleConfig for Blake3MerkleConfig<F> {
type Leaf = [F];
type LeafDigest = <Self::LeafHash as CRHScheme>::Output;
type LeafInnerDigestConverter = IdentityDigestConverter<Self::LeafDigest>;
type InnerDigest = <Self::TwoToOneHash as TwoToOneCRHScheme>::Output;
type LeafHash = Blake3F<F>; // blake3, over field elements
type TwoToOneHash = Blake3;
type LeafHash = Blake3CRH<F>;
type TwoToOneHash = Blake3TwoToOneCRH;
}
20 changes: 20 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,26 @@ impl From<spongefish::VerificationError> for VerifierError {
}
}

impl From<effsc::proof::SumcheckError> for VerifierError {
fn from(err: effsc::proof::SumcheckError) -> Self {
use effsc::proof::SumcheckError;
match err {
// Round consistency or degree mismatch detected by the library.
SumcheckError::ConsistencyCheck { .. } | SumcheckError::DegreeMismatch { .. } => {
Self::SumcheckRound
}
// Not raised by `sumcheck_verify` any more (the library dropped
// the internal oracle check); warp does the final-claim check
// itself. Retained for enum completeness.
SumcheckError::FinalEvaluation => Self::Target,
// Ran out of transcript or malformed bytes.
SumcheckError::TranscriptError { .. } => Self::SpongeFish,
// Unreachable: warp always passes a noop hook.
SumcheckError::HookError { .. } => Self::SumcheckRound,
}
}
}

#[derive(Error, Debug)]
pub enum DeciderError {
#[error("Invalid merkle root")]
Expand Down
Loading
Loading