organize nizk and scalar modules

This commit is contained in:
Srinath Setty
2020-04-28 11:41:40 -07:00
parent 958e9450db
commit 290bbc0897
6 changed files with 12 additions and 10 deletions

View File

@@ -200,7 +200,7 @@ fn set_duration() -> Criterion {
criterion_group! { criterion_group! {
name = benches_spartan; name = benches_spartan;
config = set_duration(); config = set_duration();
targets = snark_encode_benchmark, snark_prove_benchmark, snark_verify_benchmark targets = snark_encode_benchmark, snark_prove_benchmark, snark_verify_benchmark, nizk_prove_benchmark, nizk_verify_benchmark
} }
criterion_main!(benches_spartan); criterion_main!(benches_spartan);

View File

@@ -11,7 +11,6 @@ extern crate rayon;
extern crate sha3; extern crate sha3;
extern crate test; extern crate test;
mod bullet;
pub mod commitments; pub mod commitments;
pub mod dense_mlpoly; pub mod dense_mlpoly;
mod errors; mod errors;
@@ -23,7 +22,6 @@ pub mod r1csinstance;
pub mod r1csproof; pub mod r1csproof;
pub mod random; pub mod random;
pub mod scalar; pub mod scalar;
mod scalar_25519;
pub mod sparse_mlpoly; pub mod sparse_mlpoly;
pub mod spartan; pub mod spartan;
pub mod sumcheck; pub mod sumcheck;

View File

@@ -1,10 +1,10 @@
#![allow(non_snake_case)] #![allow(non_snake_case)]
use super::errors::ProofVerifyError; use super::super::errors::ProofVerifyError;
use super::group::{CompressedGroup, GroupElement, VartimeMultiscalarMul}; use super::super::group::{CompressedGroup, GroupElement, VartimeMultiscalarMul};
use super::math::Math; use super::super::math::Math;
use super::scalar::Scalar; use super::super::scalar::Scalar;
use super::transcript::ProofTranscript; use super::super::transcript::ProofTranscript;
use merlin::Transcript; use merlin::Transcript;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::iter; use std::iter;

View File

@@ -1,4 +1,3 @@
use super::bullet::BulletReductionProof;
use super::commitments::{Commitments, MultiCommitGens}; use super::commitments::{Commitments, MultiCommitGens};
use super::errors::ProofVerifyError; use super::errors::ProofVerifyError;
use super::group::CompressedGroup; use super::group::CompressedGroup;
@@ -9,6 +8,9 @@ use super::transcript::{AppendToTranscript, ProofTranscript};
use merlin::Transcript; use merlin::Transcript;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
mod bullet;
use bullet::BulletReductionProof;
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct KnowledgeProof { pub struct KnowledgeProof {
alpha: CompressedGroup, alpha: CompressedGroup,

View File

@@ -1,4 +1,6 @@
pub type Scalar = super::scalar_25519::Scalar; mod ristretto255;
pub type Scalar = ristretto255::Scalar;
pub type ScalarBytes = curve25519_dalek::scalar::Scalar; pub type ScalarBytes = curve25519_dalek::scalar::Scalar;
pub trait ScalarFromPrimitives { pub trait ScalarFromPrimitives {