// Computes the new public coefficients by combining the public coefficients in
// the dealings.
Computes the new public coefficients by combining the public coefficients in
the dealings.
Computes the new public coefficients by combining the public coefficients in the dealings .
pub fn compute_new_public_coefficients(
        new_threshold: NumberOfNodes,
        dealings: &[Option<ToyDealing>],
    ) -> PublicCoefficients {
        PublicCoefficients {
            coefficients: (0..new_threshold.get() as usize)
                .map(|coefficient_index| {
                    let new_receiver_shares: Vec<Option<PublicKey>> = dealings
                        .iter()
                        .map(|dealing_maybe| {
                            dealing_maybe
                                .as_ref()
                                .map(|dealing| dealing.0.coefficients[coefficient_index])
                        })
                        .collect();
                    resharing_util::interpolate_public_key(&new_receiver_shares)
                })
                .collect(),
        }
    }
pub fn compute_new_public_coefficients ( new_threshold : NumberOfNodes , dealings : & [ Option < ToyDealing > ] , ) -> PublicCoefficients { PublicCoefficients { coefficients : ( 0 .. new_threshold . get ( ) as usize ) . map ( | coefficient_index | { let new_receiver_shares : Vec < Option < PublicKey > > = dealings . iter ( ) . map ( | dealing_maybe | { dealing_maybe . as_ref ( ) . map ( | dealing | dealing . 0 . coefficients [ coefficient_index ] ) } ) . collect ( ) ; resharing_util :: interpolate_public_key ( & new_receiver_shares ) } ) . collect ( ) , } }
Computes the new public coefficients by combining the public coefficients in
the dealings.
Computes the new public coefficients by combining the public coefficients in the dealings .
new_threshold
NumberOfNodes
dealings
&[Option<ToyDealing>]