cleaning code

This commit is contained in:
ada
2020-11-24 02:51:35 +01:00
parent 427bfcfe15
commit 3e2c62c0bf
3 changed files with 12 additions and 10 deletions

View File

@@ -324,3 +324,6 @@ pub fn mimc_constants() -> Vec<&'static str> {
"597cdd384abdad1beccc73fb39f74a18eb44d056951d602c2ef6ef6448fc5626",
]
}
fn main() {
}

View File

@@ -1,10 +1,10 @@
use sapvi::{BlsStringConversion, Decodable, ZKContract};
use sapvi::{Decodable, ZKContract};
use std::fs::File;
use std::time::Instant;
use bls12_381::Scalar;
use ff::{Field, PrimeField};
use group::{Curve, Group, GroupEncoding};
use group::{Curve, Group};
use rand::rngs::OsRng;
type Result<T> = std::result::Result<T, failure::Error>;
@@ -13,7 +13,7 @@ type Result<T> = std::result::Result<T, failure::Error>;
fn unpack<F: PrimeField>(value: F) -> Vec<Scalar> {
let mut bits = Vec::new();
print!("Unpack: ");
for (i, bit) in value.to_le_bits().into_iter().cloned().enumerate() {
for (_i, bit) in value.to_le_bits().into_iter().cloned().enumerate() {
match bit {
true => bits.push(Scalar::one()),
false => bits.push(Scalar::zero()),

View File

@@ -1,16 +1,15 @@
use bellman::{
gadgets::{
boolean::{AllocatedBit, Boolean},
multipack, num, Assignment,
Assignment,
},
groth16, Circuit, ConstraintSystem, SynthesisError,
};
use bls12_381::Bls12;
use bls12_381::Scalar;
use ff::{Field, PrimeField};
use group::Curve;
use ff::{Field};
use rand::rngs::OsRng;
use std::ops::{MulAssign, Neg, SubAssign};
pub const CRH_IVK_PERSONALIZATION: &[u8; 8] = b"Zcashivk";
@@ -105,7 +104,7 @@ fn main() {
let proof = groth16::create_random_proof(c, &params, &mut OsRng).unwrap();
println!("Prove: [{:?}]", start.elapsed());
let start = Instant::now();
let _start = Instant::now();
let public_input = vec![bls12_381::Scalar::from(27)];