Skip to content
Open
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
162 changes: 71 additions & 91 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ lto = "fat"
strip = false
codegen-units = 1

[replace]
"ark-bn254:0.5.0" = { git = "https://github.com/a16z/arkworks-algebra", branch = "dev/twist-shout" }
"ark-ff:0.5.0" = { git = "https://github.com/a16z/arkworks-algebra", branch = "dev/twist-shout" }
"ark-ec:0.5.0" = { git = "https://github.com/a16z/arkworks-algebra", branch = "dev/twist-shout" }
"ark-serialize:0.5.0" = { git = "https://github.com/a16z/arkworks-algebra", branch = "dev/twist-shout" }
[patch.crates-io]
ark-bn254 = { git = "https://github.com/a16z/arkworks-algebra", branch = "dev/twist-shout" }
ark-ff = { git = "https://github.com/a16z/arkworks-algebra", branch = "dev/twist-shout" }
ark-ec = { git = "https://github.com/a16z/arkworks-algebra", branch = "dev/twist-shout" }
ark-serialize = { git = "https://github.com/a16z/arkworks-algebra", branch = "dev/twist-shout" }

[workspace.metadata.cargo-machete]
ignored = ["jolt-sdk"]
Expand Down
2 changes: 2 additions & 0 deletions crates/jolt-blindfold/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jolt-poly.workspace = true
jolt-r1cs.workspace = true
jolt-sumcheck = { workspace = true, features = ["r1cs"] }
jolt-transcript.workspace = true
rand_core.workspace = true
rayon.workspace = true
serde = { workspace = true, features = ["derive"] }
thiserror.workspace = true

Expand Down
53 changes: 53 additions & 0 deletions crates/jolt-blindfold/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,59 @@ pub enum RelaxedError {
},
}

#[derive(Debug, ThisError)]
pub enum ProverError<F: FieldCore> {
#[error(transparent)]
Relaxed(#[from] RelaxedError),
#[error(transparent)]
R1csMatrix(#[from] ConstraintMatrixEvalError),
#[error(transparent)]
VectorOpening(#[from] VectorOpeningError),
#[error("{name} length mismatch: expected {expected}, got {actual}")]
LengthMismatch {
name: &'static str,
expected: usize,
actual: usize,
},
#[error("witness row {row} length mismatch: expected {expected}, got {actual}")]
WitnessRowLengthMismatch {
row: usize,
expected: usize,
actual: usize,
},
#[error("{name} row length {row_len} exceeds vector commitment capacity {capacity}")]
CommitmentCapacityExceeded {
name: &'static str,
capacity: usize,
row_len: usize,
},
#[error("{name} row commitment backend failed: {reason}")]
RowCommitmentBackend { name: &'static str, reason: String },
#[error("{name} backend kernel failed: {reason}")]
BackendKernel { name: &'static str, reason: String },
#[error("{name} must be a non-zero power of two, got {value}")]
InvalidPowerOfTwo { name: &'static str, value: usize },
#[error("{name} dimension {value} cannot be represented")]
DimensionOverflow { name: &'static str, value: usize },
#[error("folded eval commitment {index} does not match opened value and blinding")]
EvalCommitmentMismatch { index: usize },
#[error("folded eval witness {kind} {index} does not match opened witness coordinate: expected {expected}, got {actual}")]
EvalWitnessMismatch {
kind: &'static str,
index: usize,
expected: F,
actual: F,
},
#[error("interpolation denominator is zero for degree {degree} at point {point}")]
ZeroInterpolationDenominator { degree: usize, point: usize },
#[error("sumcheck round claim mismatch: expected {expected}, got {actual}")]
SumcheckRoundClaimMismatch { expected: F, actual: F },
#[error("multilinear evaluation length mismatch: expected {expected}, got {actual}")]
MultilinearLengthMismatch { expected: usize, actual: usize },
#[error("{name} must have at least one sumcheck round")]
DegenerateSumcheck { name: &'static str },
}

#[derive(Debug, ThisError)]
pub enum VerificationError<F: FieldCore> {
#[error("claims have {claim_stages} stages but proof has {proof_stages}")]
Expand Down
8 changes: 7 additions & 1 deletion crates/jolt-blindfold/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,25 @@ mod builder;
mod error;
mod proof;
pub mod protocol;
mod prove;
pub mod r1cs;
mod relaxed;
mod statements;
mod verify;

pub use builder::{BlindFoldProtocolBuilder, BlindFoldStageBuilder};
pub use error::{Error, LayoutError, RelaxedError, VerificationError};
pub use error::{Error, LayoutError, ProverError, RelaxedError, VerificationError};
pub use proof::BlindFoldProof;
pub use protocol::{
BlindFoldDimensions, BlindFoldProtocol, FinalOpeningWitnessCoordinates, RowDimensions,
WitnessCoordinate, WitnessRowLayout,
};
pub use prove::{
prove, prove_with_row_committer, BlindFoldRowCommitter, BlindFoldWitness,
DirectBlindFoldRowCommitter,
};
pub use relaxed::{RelaxedInstance, RelaxedWitness};
pub use statements::{
BlindFoldStage, BlindFoldStatement, CommittedClaimRows, FinalOpeningBinding, OpeningAlias,
};
pub use verify::verify;
7 changes: 4 additions & 3 deletions crates/jolt-blindfold/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ use jolt_r1cs::{ConstraintMatrices, R1csBuilder, Variable};
use jolt_sumcheck::{CommittedOutputClaims, CommittedSumcheckConsistency};

use crate::{
r1cs::Layout, BlindFoldProtocolBuilder, BlindFoldStatement, Error, RelaxedError,
RelaxedInstance, VerificationError,
r1cs::{build_with_sources, Layout},
BlindFoldProtocolBuilder, BlindFoldStatement, Error, RelaxedError, RelaxedInstance,
VerificationError,
};

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -437,7 +438,7 @@ where
challenges: &[(Ch, F)],
) -> Result<(ConstraintMatrices<F>, Layout), VerificationError<F>> {
let mut r1cs = R1csBuilder::new();
let layout = self.build_with_sources(&mut r1cs, publics, challenges)?;
let layout = build_with_sources(&mut r1cs, self, publics, challenges)?;
Ok((r1cs.into_matrices(), layout))
}
}
Expand Down
Loading