From eb05d00080fc0be9ce93558811e82997b962be6c Mon Sep 17 00:00:00 2001 From: Aitor Ruano Date: Mon, 23 Mar 2020 15:16:43 +0100 Subject: [PATCH] upgrade version --- Cargo.toml | 2 +- src/math.rs | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 02dc2af..30c06c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sharks" -version = "0.3.2" +version = "0.3.3" authors = ["Aitor Ruano "] description = "Fast, small and secure Shamir's Secret Sharing library crate" homepage = "https://github.com/c0dearm/sharks" diff --git a/src/math.rs b/src/math.rs index a760cb0..187709d 100644 --- a/src/math.rs +++ b/src/math.rs @@ -49,14 +49,12 @@ pub fn random_polynomial(s: GF256, k: u8) -> Vec { // Each polynomial corresponds to one byte chunk of the original secret. // The iterator will start at `x = 1` and end at `x = 255`. pub fn get_evaluator(polys: Vec>) -> impl Iterator { - (1..=u8::max_value()).map(GF256).map(move |x| { - (Share { - x, - y: polys - .iter() - .map(|p| p.iter().fold(GF256(0), |acc, c| acc * x + *c)) - .collect(), - }) + (1..=u8::max_value()).map(GF256).map(move |x| Share { + x, + y: polys + .iter() + .map(|p| p.iter().fold(GF256(0), |acc, c| acc * x + *c)) + .collect(), }) }