mirror of
https://github.com/serai-dex/serai.git
synced 2024-11-16 17:07:35 +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:
parent
8bee62609c
commit
87dea5e455
1 changed files with 1 additions and 0 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue