/// Given multiple public keys (y values) at different points (which give x
/// values) interpolate the value at zero.
Given multiple public keys (y values) at different points (which give x
values) interpolate the value at zero.
Given multiple public keys ( y values ) at different points ( which give x values ) interpolate the value at zero .
pub fn interpolate_public_key(shares: &[Option<PublicKey>]) -> PublicKey {
        let shares: Vec<(SecretKey, G2Projective)> = shares
            .iter()
            .enumerate()
            .filter_map(|(index, share_maybe)| {
                share_maybe.map(|share| (crypto::x_for_index(index as NodeIndex), share.0))
            })
            .collect();
        PublicKey(PublicCoefficients::interpolate_g2(&shares).unwrap())
    }
pub fn interpolate_public_key ( shares : & [ Option < PublicKey > ] ) -> PublicKey { let shares : Vec < ( SecretKey , G2Projective ) > = shares . iter ( ) . enumerate ( ) . filter_map ( | ( index , share_maybe ) | { share_maybe . map ( | share | ( crypto :: x_for_index ( index as NodeIndex ) , share . 0 ) ) } ) . collect ( ) ; PublicKey ( PublicCoefficients :: interpolate_g2 ( & shares ) . unwrap ( ) ) }
Given multiple public keys (y values) at different points (which give x
values) interpolate the value at zero.
Given multiple public keys ( y values ) at different points ( which give x values ) interpolate the value at zero .
shares
&[Option<PublicKey>]