diff --git a/src/math.rs b/src/math.rs index 6ae678d..865f1cc 100644 --- a/src/math.rs +++ b/src/math.rs @@ -30,12 +30,12 @@ pub fn interpolate(shares: &[Share]) -> Vec { .collect() } -// Generates `k` polynomial coefficients, being the last one `s` and the others randomly generated between `[1, 255]`. +// Generates `k` polynomial coefficients, being the last one `s` and the others randomly generated between `[0, 255]`. // Coefficient degrees go from higher to lower in the returned vector order. pub fn random_polynomial(s: GF256, k: u8, rng: &mut R) -> Vec { let k = k as usize; let mut poly = Vec::with_capacity(k); - let between = Uniform::new_inclusive(1, 255); + let between = Uniform::new_inclusive(0, 255); for _ in 1..k { poly.push(GF256(between.sample(rng)));