From 6e7aabaf58da9775cfbad6c876bc597697234015 Mon Sep 17 00:00:00 2001 From: Magnus Jensen Date: Wed, 29 Nov 2023 10:39:53 +0100 Subject: [PATCH] Remove warnings --- src/node.rs | 3 +-- src/schnorr.rs | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/node.rs b/src/node.rs index 032b3fc..c37ec2e 100644 --- a/src/node.rs +++ b/src/node.rs @@ -110,6 +110,7 @@ impl Node { /// Converts an array of boolean values, representing the /// input of Alice or Bob, into input nodes, to be used in /// the boolean circuit. +#[allow(dead_code)] pub fn as_nodes(arr: [Nat; 3], modulus: NonZero) -> [Node; 3] { // Sample random bits let mut buf = [0]; @@ -149,7 +150,6 @@ mod tests { use crate::{ circuit::{deal_rands, push_node, Circuit, Rands}, - groups::GroupSpec, nat::{mul_mod, Nat}, node::{Const, Node}, shares::Shares, @@ -379,4 +379,3 @@ mod tests { } } } - diff --git a/src/schnorr.rs b/src/schnorr.rs index 36f4614..6cde2b8 100644 --- a/src/schnorr.rs +++ b/src/schnorr.rs @@ -1,7 +1,7 @@ use std::env; use crypto_bigint::Encoding; -use sha2::{Digest, Sha256, Sha512}; +use sha2::{Digest, Sha256}; use crate::{ circuit::{push_node, Circuit}, @@ -51,10 +51,10 @@ pub fn run_schnorr(m: Nat, verbose: bool) { let sk_share = Shares::new(&sk, group.q); // Construct net schnorr circuit - let curcuit = schnorr_circuit(r_shares, sk_share, e); + let circuit = schnorr_circuit(r_shares, sk_share, e); // Evaluate the circuit - let result = curcuit.eval(); + let result = circuit.eval(); // Open the result to get the second component z of the signature let z = result.open(); @@ -77,7 +77,7 @@ pub fn run_schnorr(m: Nat, verbose: bool) { // Compute e_verify = Sha256(c_verify, m) let e_verify = compute_e(c_verify, m); - if (verbose) { + if verbose { println!("group: {:?}", group); println!("r1: {:?}", r1); println!("r2: {:?}", r2);