Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 9 additions & 0 deletions jolt-core/src/poly/commitment/commitment_scheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ pub trait CommitmentScheme: Clone + Sync + Send + 'static {
type Field: JoltField + Sized;
type ProverSetup: Clone + Sync + Send + Debug + CanonicalSerialize + CanonicalDeserialize;
type VerifierSetup: Clone + Sync + Send + Debug + CanonicalSerialize + CanonicalDeserialize;
type CompressedCommitment: Default
+ Debug
+ Sync
+ Send
+ PartialEq
+ CanonicalSerialize
+ CanonicalDeserialize
+ AppendToTranscript
+ Clone;
type Commitment: Default
+ Debug
+ Sync
Expand Down
9 changes: 6 additions & 3 deletions jolt-core/src/poly/commitment/dory/commitment_scheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use super::dory_globals::DoryGlobals;
use super::jolt_dory_routines::{JoltG1Routines, JoltG2Routines};
use super::wrappers::{
jolt_to_ark, ArkDoryProof, ArkFr, ArkG1, ArkGT, ArkworksProverSetup, ArkworksVerifierSetup,
JoltToDoryTranscript, BN254,
jolt_to_ark, ArkDoryProof, ArkFr, ArkG1, ArkGT, ArkGTCompressed, ArkworksProverSetup,
ArkworksVerifierSetup, JoltToDoryTranscript, BN254,
};
use crate::{
field::JoltField,
Expand All @@ -26,7 +26,9 @@ use std::borrow::Borrow;
use tracing::trace_span;

#[derive(Clone)]
pub struct DoryCommitmentScheme;
pub struct DoryCommitmentScheme {
compression_enabled: bool,
}

impl CommitmentScheme for DoryCommitmentScheme {
type Field = ark_bn254::Fr;
Expand All @@ -36,6 +38,7 @@ impl CommitmentScheme for DoryCommitmentScheme {
type Proof = ArkDoryProof;
type BatchedProof = Vec<ArkDoryProof>;
type OpeningProofHint = Vec<ArkG1>;
type CompressedCommitment = ArkGTCompressed;

fn setup_prover(max_num_vars: usize) -> Self::ProverSetup {
let _span = trace_span!("DoryCommitmentScheme::setup_prover").entered();
Expand Down
15 changes: 14 additions & 1 deletion jolt-core/src/poly/commitment/dory/wrappers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
use rayon::prelude::*;

pub use dory::backends::arkworks::{
ArkDoryProof, ArkFr, ArkG1, ArkG2, ArkGT, ArkworksProverSetup, ArkworksVerifierSetup, BN254,
ArkDoryProof, ArkFr, ArkG1, ArkG2, ArkGT, ArkGTCompressed, ArkworksProverSetup,

Check failure on line 26 in jolt-core/src/poly/commitment/dory/wrappers.rs

View workflow job for this annotation

GitHub Actions / clippy

unresolved import `dory::backends::arkworks::ArkGTCompressed`

Check failure on line 26 in jolt-core/src/poly/commitment/dory/wrappers.rs

View workflow job for this annotation

GitHub Actions / jolt binary check

unresolved import `dory::backends::arkworks::ArkGTCompressed`

Check failure on line 26 in jolt-core/src/poly/commitment/dory/wrappers.rs

View workflow job for this annotation

GitHub Actions / Test jolt-core

unresolved import `dory::backends::arkworks::ArkGTCompressed`

Check failure on line 26 in jolt-core/src/poly/commitment/dory/wrappers.rs

View workflow job for this annotation

GitHub Actions / Jolt SDK Verifier Tests

unresolved import `dory::backends::arkworks::ArkGTCompressed`

Check failure on line 26 in jolt-core/src/poly/commitment/dory/wrappers.rs

View workflow job for this annotation

GitHub Actions / Test tracer

unresolved import `dory::backends::arkworks::ArkGTCompressed`

Check failure on line 26 in jolt-core/src/poly/commitment/dory/wrappers.rs

View workflow job for this annotation

GitHub Actions / Build Wasm

unresolved import `dory::backends::arkworks::ArkGTCompressed`
ArkworksVerifierSetup, BN254,
};

pub type JoltFieldWrapper = ArkFr;
Expand All @@ -40,6 +41,18 @@
}
}

impl AppendToTranscript for ArkGTCompressed {
fn append_to_transcript<S: Transcript>(&self, transcript: &mut S) {
transcript.append_serializable(self);
}
}

impl AppendToTranscript for &ArkGTCompressed {
fn append_to_transcript<S: Transcript>(&self, transcript: &mut S) {
transcript.append_serializable(*self);
}
}

impl AppendToTranscript for ArkDoryProof {
fn append_to_transcript<S: Transcript>(&self, transcript: &mut S) {
transcript.append_serializable(self);
Expand Down
1 change: 1 addition & 0 deletions jolt-core/src/poly/commitment/hyperkzg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ where
type Proof = HyperKZGProof<P>;
type BatchedProof = HyperKZGProof<P>;
type OpeningProofHint = ();
type CompressedCommitment = Self::Commitment;

fn setup_prover(max_num_vars: usize) -> Self::ProverSetup {
HyperKZGSRS(Arc::new(SRS::setup(
Expand Down
1 change: 1 addition & 0 deletions jolt-core/src/poly/commitment/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ where
type Proof = MockProof<F>;
type BatchedProof = MockProof<F>;
type OpeningProofHint = ();
type CompressedCommitment = Self::Commitment;

fn setup_prover(_num_vars: usize) -> Self::ProverSetup {}

Expand Down
Loading