Last active
January 20, 2023 06:55
-
-
Save kayabaNerve/3ff25aa5815c3d715654e1486e8a85ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn polynomial<F: PrimeField + Zeroize>(coefficients: &[Zeroizing<F>], l: u16) -> Zeroizing<F> { | |
let l = F::from(u64::from(l)); | |
let mut share = Zeroizing::new(F::zero()); | |
for (idx, coefficient) in coefficients.iter().rev().enumerate() { | |
*share += coefficient.deref(); | |
if idx != (coefficients.len() - 1) { | |
*share *= l; | |
} | |
} | |
share | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment