mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
3.3.3 Add an assert if polynomial is called with 0
This will only be called with 0 if the code fails to do proper screening of its arguments. If such a flaw is present, the DKG lib is critically broken (as this function isn't public). If it was allowed to continue executing, it'd reveal the secret share.
This commit is contained in:
@@ -151,6 +151,7 @@ impl<C: Ciphersuite> KeyGenMachine<C> {
|
||||
}
|
||||
|
||||
fn polynomial<F: PrimeField + Zeroize>(coefficients: &[Zeroizing<F>], l: u16) -> Zeroizing<F> {
|
||||
assert!(l != 0, "attempting to evaluate a polynomial with 0");
|
||||
let l = F::from(u64::from(l));
|
||||
let mut share = Zeroizing::new(F::zero());
|
||||
for (idx, coefficient) in coefficients.iter().rev().enumerate() {
|
||||
|
||||
Reference in New Issue
Block a user