fn verify_share(share: &Share) -> Result<(), &'static str> {
    let f_result = SpendAuth::basepoint() * share.value.0;

    let x = Scalar::from(share.receiver_index as u64);

    let (_, result) = share.commitment.0.iter().fold(
        (Scalar::one(), jubjub::ExtendedPoint::identity()),
        |(x_to_the_i, sum_so_far), comm_i| (x_to_the_i * x, sum_so_far + comm_i.0 * x_to_the_i),
    );

    if !(f_result == result) {
        return Err("Share is invalid.");
    }

    Ok(())
}
/// Verifies that a share is consistent with a commitment.
///
/// This ensures that this participant's share has been generated using the same
/// mechanism as all other signing participants. Note that participants *MUST*
/// ensure that they have the same view as all other participants of the
/// commitment!
Verifies that a share is consistent with a commitment.
This ensures that this participant's share has been generated using the same
mechanism as all other signing participants. Note that participants *MUST
ensure that they have the same view as all other participants of the
commitment!
Verifies that a share is consistent with a commitment . This ensures that this participant ' s share has been generated using the same mechanism as all other signing participants . Note that participants * MUST ensure that they have the same view as all other participants of the commitment!
fn verify_share(share: &Share) -> Result<(), &'static str> {
    let f_result = SpendAuth::basepoint() * share.value.0;
    let x = Scalar::from(share.receiver_index as u64);
    let (_, result) = share.commitment.0.iter().fold(
        (Scalar::one(), jubjub::ExtendedPoint::identity()),
        |(x_to_the_i, sum_so_far), comm_i| (x_to_the_i * x, sum_so_far + comm_i.0 * x_to_the_i),
    );
    if !(f_result == result) {
        return Err("Share is invalid.");
    }
    Ok(())
}
fn verify_share ( share : & Share ) -> Result < ( ) , & ' static str > { let f_result = SpendAuth :: basepoint ( ) * share . value . 0 ; let x = Scalar :: from ( share . receiver_index as u64 ) ; let ( _ , result ) = share . commitment . 0 . iter ( ) . fold ( ( Scalar :: one ( ) , jubjub :: ExtendedPoint :: identity ( ) ) , | ( x_to_the_i , sum_so_far ) , comm_i | ( x_to_the_i * x , sum_so_far + comm_i . 0 * x_to_the_i ) , ) ; if ! ( f_result == result ) { return Err ( " " ) ; } Ok ( ( ) ) }
Verifies that a share is consistent with a commitment.
Verifies that a share is consistent with a commitment .
share
&Share