upgrade version

This commit is contained in:
Aitor Ruano 2020-03-23 15:16:43 +01:00
parent 912fef96b1
commit eb05d00080
2 changed files with 7 additions and 9 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "sharks"
version = "0.3.2"
version = "0.3.3"
authors = ["Aitor Ruano <codearm@pm.me>"]
description = "Fast, small and secure Shamir's Secret Sharing library crate"
homepage = "https://github.com/c0dearm/sharks"

View File

@ -49,14 +49,12 @@ pub fn random_polynomial(s: GF256, k: u8) -> Vec<GF256> {
// 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<Vec<GF256>>) -> impl Iterator<Item = Share> {
(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(),
})
}