Browse Source

organize nizk and scalar modules

master
Srinath Setty 4 years ago
parent
commit
290bbc0897
6 changed files with 12 additions and 10 deletions
  1. +1
    -1
      benches/spartan.rs
  2. +0
    -2
      src/lib.rs
  3. +5
    -5
      src/nizk/bullet.rs
  4. +3
    -1
      src/nizk/mod.rs
  5. +3
    -1
      src/scalar/mod.rs
  6. +0
    -0
      src/scalar/ristretto255.rs

+ 1
- 1
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);

+ 0
- 2
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;

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;

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;
@ -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,

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 {

src/scalar_25519.rs → src/scalar/ristretto255.rs


Loading…
Cancel
Save