-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
212 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use std::borrow::Borrow; | ||
|
||
use ark_std::iterable::Iterable; | ||
use merlin::Transcript; | ||
|
||
use crate::utils::transcript; | ||
|
||
pub trait CommitmentScheme { | ||
type Commitment; | ||
type Evaluation; | ||
type Polynomial; | ||
type Challenge; | ||
type Proof; | ||
type Error; | ||
|
||
type ProverKey; | ||
type VerifierKey; | ||
|
||
//TODO: convert to impl IntoIterator<Item = Self::Polynomial> | ||
fn commit( | ||
polys: &[Self::Polynomial], | ||
ck: &Self::ProverKey | ||
) -> Result<Vec<Self::Commitment>, Self::Error>; | ||
|
||
fn prove( | ||
polys: &[Self::Polynomial], | ||
evals: &[Self::Evaluation], | ||
challenges: &[Self::Challenge], | ||
pk: impl Borrow<Self::ProverKey>, | ||
transcript: &mut Transcript | ||
) -> Result<Self::Proof, Self::Error>; | ||
|
||
fn verify( | ||
commitments: &[Self::Commitment], | ||
evals: &[Self::Evaluation], | ||
challenges: &[Self::Challenge], | ||
vk: impl Borrow<Self::VerifierKey>, | ||
transcript: &mut Transcript, | ||
proof: Self::Proof, | ||
) -> Result<bool, Self::Error>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.