organize nizk and scalar modules
Srinath Setty srinath@microsoft.com
Tue, 28 Apr 2020 11:41:40 -0700
6 files changed,
12 insertions(+),
10 deletions(-)
M
benches/spartan.rs
→
benches/spartan.rs
@@ -200,7 +200,7 @@
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);
M
src/bullet.rs
→
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;
M
src/lib.rs
→
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;
M
src/nizk.rs
→
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;@@ -8,6 +7,9 @@ use super::scalar::Scalar;
use super::transcript::{AppendToTranscript, ProofTranscript}; use merlin::Transcript; use serde::{Deserialize, Serialize}; + +mod bullet; +use bullet::BulletReductionProof; #[derive(Serialize, Deserialize, Debug)] pub struct KnowledgeProof {
M
src/scalar.rs
→
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 {