Skip to content

Commit

Permalink
Merge branch 'main' into feat/verifier-setup-file-io
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin-Ray authored Oct 22, 2024
2 parents 3c13348 + 8772412 commit 5698da1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ arrow-csv = { version = "51.0" }
bit-iter = { version = "1.1.1" }
bigdecimal = { version = "0.4.5", default-features = false, features = ["serde"] }
blake3 = { version = "1.3.3", default-features = false }
blitzar = { version = "3.3.0" }
blitzar = { version = "3.4.0" }
bumpalo = { version = "3.11.0" }
bytemuck = {version = "1.16.3", features = ["derive"]}
byte-slice-cast = { version = "1.2.1", default-features = false }
Expand Down
35 changes: 35 additions & 0 deletions crates/proof-of-sql/src/proof_primitive/dory/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,41 @@ impl<'a> ProverSetup<'a> {
}
}

/// Create a new `ProverSetup` from the public parameters and blitzar handle
/// # Panics
/// Panics if the length of `Gamma_1` or `Gamma_2` is not equal to `2^max_nu`.
#[must_use]
#[cfg(feature = "blitzar")]
pub fn from_public_parameters_and_blitzar_handle(
public_parameters: &'a PublicParameters,
blitzar_handle: blitzar::compute::MsmHandle<
blitzar::compute::ElementP2<ark_bls12_381::g1::Config>,
>,
) -> Self {
let Gamma_1: &'a [G1Affine] = &public_parameters.Gamma_1;
let Gamma_2: &'a [G2Affine] = &public_parameters.Gamma_2;
let H_1 = public_parameters.H_1;
let H_2 = public_parameters.H_2;
let Gamma_2_fin = public_parameters.Gamma_2_fin;
let max_nu = public_parameters.max_nu;
assert_eq!(Gamma_1.len(), 1 << max_nu);
assert_eq!(Gamma_2.len(), 1 << max_nu);

let (Gamma_1, Gamma_2): (Vec<_>, Vec<_>) = (0..=max_nu)
.map(|k| (&Gamma_1[..1 << k], &Gamma_2[..1 << k]))
.unzip();
ProverSetup {
Gamma_1,
Gamma_2,
H_1,
H_2,
Gamma_2_fin,
max_nu,
#[cfg(feature = "blitzar")]
blitzar_handle,
}
}

#[cfg(feature = "blitzar")]
#[tracing::instrument(name = "ProverSetup::blitzar_msm", level = "debug", skip_all)]
pub(super) fn blitzar_msm(
Expand Down

0 comments on commit 5698da1

Please sign in to comment.