diff --git a/benches/spartan.rs b/benches/spartan.rs index 6fc06cb..9a3db16 100644 --- a/benches/spartan.rs +++ b/benches/spartan.rs @@ -200,7 +200,7 @@ fn set_duration() -> Criterion { criterion_group! { name = benches_spartan; 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); diff --git a/src/lib.rs b/src/lib.rs index b753f02..1908028 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,7 +11,6 @@ extern crate rayon; extern crate sha3; extern crate test; -mod bullet; pub mod commitments; pub mod dense_mlpoly; mod errors; @@ -23,7 +22,6 @@ pub mod r1csinstance; pub mod r1csproof; pub mod random; pub mod scalar; -mod scalar_25519; pub mod sparse_mlpoly; pub mod spartan; pub mod sumcheck; diff --git a/src/bullet.rs b/src/nizk/bullet.rs similarity index 96% rename from src/bullet.rs rename to src/nizk/bullet.rs index 36c3377..80ed9ec 100644 --- a/src/bullet.rs +++ b/src/nizk/bullet.rs @@ -1,10 +1,10 @@ #![allow(non_snake_case)] -use super::errors::ProofVerifyError; -use super::group::{CompressedGroup, GroupElement, VartimeMultiscalarMul}; -use super::math::Math; -use super::scalar::Scalar; -use super::transcript::ProofTranscript; +use super::super::errors::ProofVerifyError; +use super::super::group::{CompressedGroup, GroupElement, VartimeMultiscalarMul}; +use super::super::math::Math; +use super::super::scalar::Scalar; +use super::super::transcript::ProofTranscript; use merlin::Transcript; use serde::{Deserialize, Serialize}; use std::iter; diff --git a/src/nizk.rs b/src/nizk/mod.rs similarity index 99% rename from src/nizk.rs rename to src/nizk/mod.rs index 00db3f8..71617d0 100644 --- a/src/nizk.rs +++ b/src/nizk/mod.rs @@ -1,4 +1,3 @@ -use super::bullet::BulletReductionProof; use super::commitments::{Commitments, MultiCommitGens}; use super::errors::ProofVerifyError; use super::group::CompressedGroup; @@ -9,6 +8,9 @@ use super::transcript::{AppendToTranscript, ProofTranscript}; use merlin::Transcript; use serde::{Deserialize, Serialize}; +mod bullet; +use bullet::BulletReductionProof; + #[derive(Serialize, Deserialize, Debug)] pub struct KnowledgeProof { alpha: CompressedGroup, diff --git a/src/scalar.rs b/src/scalar/mod.rs similarity index 94% rename from src/scalar.rs rename to src/scalar/mod.rs index 6fa787e..e90ec7e 100644 --- a/src/scalar.rs +++ b/src/scalar/mod.rs @@ -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 trait ScalarFromPrimitives { diff --git a/src/scalar_25519.rs b/src/scalar/ristretto255.rs similarity index 100% rename from src/scalar_25519.rs rename to src/scalar/ristretto255.rs