Skip to content

Commit

Permalink
Merge pull request #8 from PayneJoe/ark-nifs
Browse files Browse the repository at this point in the history
Ark nifs
  • Loading branch information
PayneJoe authored Dec 16, 2023
2 parents 4544fdf + 63b26bf commit 24643bd
Show file tree
Hide file tree
Showing 15 changed files with 938 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"./Cargo.toml",
"./Cargo.toml",
"./Cargo.toml",
"./Cargo.toml",
"./Cargo.toml",
"./Cargo.toml",
"./Cargo.toml"
]
}
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ rayon = "1.7"
num-traits = "0.2"
digest = "0.10"
generic-array = "1.0.0"
ark-bn254 = "0.4.0"

ark-crypto-primitives = { version = "0.4.0", default-features = false, features = [
"sponge",
Expand All @@ -22,6 +23,5 @@ ark-std = { version = "0.4.0", default-features = false }
ark-ec = {version = "0.4.0", default-features = false}
ark-ff = {version= "0.4.0", default-features = false}
ark-poly = {version = "0.4.0", default-features = false}
ark-bn254 = "0.4.0"
jf_primitives = {git = "https://github.com/EspressoSystems/jellyfish", package = "jf-primitives"}
jf_utils = {git = "https://github.com/EspressoSystems/jellyfish", package = "jf-utils"}
8 changes: 8 additions & 0 deletions src/lib.rs
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;
42 changes: 42 additions & 0 deletions src/nifs.rs
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!()
}
}
Loading

0 comments on commit 24643bd

Please sign in to comment.