From 007b55a843e5fc0b2c92fa3be38fb01bb84c59cc Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Sun, 27 Dec 2015 20:24:45 -0700 Subject: [PATCH] Clean up warnings --- src/keccak.rs | 16 +++++++--------- src/main.rs | 5 ----- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/keccak.rs b/src/keccak.rs index b95bd7e..e90339c 100644 --- a/src/keccak.rs +++ b/src/keccak.rs @@ -1,6 +1,4 @@ -//use tinysnark::FieldT; - -const keccakf_rndc: [u64; 24] = +const KECCAKF_RNDC: [u64; 24] = [ 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, @@ -12,13 +10,13 @@ const keccakf_rndc: [u64; 24] = 0x8000000000008080, 0x0000000080000001, 0x8000000080008008 ]; -const keccakf_rotc: [usize; 24] = +const KECCAKF_ROTC: [usize; 24] = [ 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 2, 14, 27, 41, 56, 8, 25, 43, 62, 18, 39, 61, 20, 44 ]; -const keccakf_piln: [usize; 24] = +const KECCAKF_PILN: [usize; 24] = [ 10, 7, 11, 17, 18, 3, 5, 16, 8, 21, 24, 4, 15, 23, 19, 13, 12, 2, 20, 14, 22, 9, 6, 1 @@ -71,10 +69,10 @@ fn keccakf(st: &mut [Chunk], rounds: usize) let mut tmp = st[1].clone(); for i in 0..24 { - let j = keccakf_piln[i]; + let j = KECCAKF_PILN[i]; bc[0] = st[j].clone(); - st[j] = tmp.rotl(keccakf_rotc[i]); + st[j] = tmp.rotl(KECCAKF_ROTC[i]); tmp = bc[0].clone(); } } @@ -106,11 +104,11 @@ fn keccakf(st: &mut [Chunk], rounds: usize) st[0] ^= keccakf_rndc[round]; */ - st[0] = st[0].xor(&keccakf_rndc[round].into()); + st[0] = st[0].xor(&KECCAKF_RNDC[round].into()); } } -fn keccak256(mut input: &[Byte]) -> Vec { +fn keccak256(input: &[Byte]) -> Vec { assert_eq!(input.len(), 144); let mut st: Vec = Some(Chunk::from(0)).into_iter().cycle().take(25).collect(); diff --git a/src/main.rs b/src/main.rs index 473dcef..8c0a793 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,17 +1,13 @@ -#![feature(clone_from_slice)] - extern crate tinysnark; extern crate rand; use tinysnark::{Proof, Keypair, FieldT, LinearTerm, ConstraintSystem}; -use std::marker::PhantomData; mod keccak; fn main() { tinysnark::init(); - /* let mut cs = ConstraintSystem::new(2, 1); // xor // (2*b) * c = b+c - a @@ -28,5 +24,4 @@ fn main() { let kp = Keypair::new(&cs); let proof = Proof::new(&kp, &prompt, &solution); assert!(proof.verify(&kp, &prompt)); - */ }