-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from PayneJoe/ark-nifs
Ark nifs
- Loading branch information
Showing
15 changed files
with
938 additions
and
18 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
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 |
---|---|---|
@@ -1,4 +1,12 @@ | ||
pub mod error; | ||
pub mod nifs; | ||
pub mod plonk; | ||
pub mod poseidon; | ||
pub mod primary; | ||
pub mod provider; | ||
pub mod secondary; | ||
pub mod traits; | ||
|
||
type Commitment<G> = <<G as traits::Group>::CE as traits::CommitmentEngineTrait<G>>::Commitment; | ||
type CommitmentKey<G> = | ||
<<G as traits::Group>::CE as traits::CommitmentEngineTrait<G>>::CommitmentKey; |
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,42 @@ | ||
use crate::{ | ||
error::MyError, | ||
plonk::*, | ||
traits::{Group, ROConstantsTrait, ROTrait}, | ||
Commitment, CommitmentKey, | ||
}; | ||
use std::marker::PhantomData; | ||
|
||
pub struct NIFS<G: Group> { | ||
pub(crate) comm_T: Commitment<G>, | ||
_p: PhantomData<G>, | ||
} | ||
|
||
impl<G: Group> NIFS<G> { | ||
pub fn prove( | ||
ck: &CommitmentKey<G>, | ||
pp_digest: &<G as Group>::ScalarField, | ||
S: &PLONKShape<G>, | ||
U1: &RelaxedPLONKInstance<G>, | ||
W1: &RelaxedPLONKWitness<G>, | ||
U2: &PLONKInstance<G>, | ||
W2: &PLONKWitness<G>, | ||
) -> Result<(NIFS<G>, (RelaxedPLONKInstance<G>, RelaxedPLONKWitness<G>)), MyError> { | ||
let constants = <<G as Group>::RO as ROTrait< | ||
<G as Group>::BaseField, | ||
<G as Group>::ScalarField, | ||
>>::Constants::new(3); | ||
let ro = <<G as Group>::RO as ROTrait< | ||
<G as Group>::BaseField, | ||
<G as Group>::ScalarField, | ||
>>::new(constants.clone()); | ||
todo!() | ||
} | ||
pub fn verifiy( | ||
&self, | ||
pp_digest: &<G as Group>::ScalarField, | ||
U1: &RelaxedPLONKInstance<G>, | ||
U2: &PLONKInstance<G>, | ||
) -> Result<RelaxedPLONKInstance<G>, MyError> { | ||
todo!() | ||
} | ||
} |
Oops, something went wrong.