upgrade version
This commit is contained in:
parent
912fef96b1
commit
eb05d00080
|
@ -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"
|
||||
|
|
14
src/math.rs
14
src/math.rs
|
@ -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(),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue