Fix bug where threshold did not set deg of secret polynomial

Fixes #43.

Fixes a syntactic error. Threshold should determine the number of coefficients
in the secret polynomial. As is the code is equivalent to threshold always being
2.
This commit is contained in:
Noah Vesely
2018-03-01 19:41:44 -06:00
committed by Romain Ruetschi
parent 3e89d1b1ca
commit 3de16890a4

View File

@ -72,7 +72,7 @@ impl SSS {
for _ in 0..(shares_count as usize) {
result.push(vec![0u8; src.len()]);
}
let mut col_in = vec![0u8, threshold];
let mut col_in = vec![0u8; threshold as usize];
let mut col_out = Vec::with_capacity(shares_count as usize);
let mut osrng = OsRng::new()?;
for (c, &s) in src.iter().enumerate() {