pub fn receive_shares(self, shares: Vec<Scalar>) -> Result<Signature, MusigError> {
        // Move out self's fields because `self.c` inside `map`'s closure would
        // lead to capturing `self` by reference, while we want
        // to move `self.counterparties` out of it.
        // See also RFC2229: https://github.com/rust-lang/rfcs/pull/2229
        let challenge = self.c;
        let multikey = &self.multikey;

        // Check that all shares are valid. If so, create s from them.
        // s = sum(s_i), s_i = shares[i]
        let s = self
            .counterparties
            .into_iter()
            .zip(shares)
            .map(|(counterparty, share)| counterparty.sign(share, challenge, multikey))
            .sum::<Result<_, _>>()?;

        Ok(Signature {
            s,
            R: self.R.compress(),
        })
    }
/// Verify and assemble signature shares.
Verify and assemble signature shares.
Verify and assemble signature shares .
pub fn receive_shares(self, shares: Vec<Scalar>) -> Result<Signature, MusigError> {
        // Move out self's fields because `self.c` inside `map`'s closure would
        // lead to capturing `self` by reference, while we want
        // to move `self.counterparties` out of it.
        // See also RFC2229: https://github.com/rust-lang/rfcs/pull/2229
        let challenge = self.c;
        let multikey = &self.multikey;
        // Check that all shares are valid. If so, create s from them.
        // s = sum(s_i), s_i = shares[i]
        let s = self
            .counterparties
            .into_iter()
            .zip(shares)
            .map(|(counterparty, share)| counterparty.sign(share, challenge, multikey))
            .sum::<Result<_, _>>()?;
        Ok(Signature {
            s,
            R: self.R.compress(),
        })
    }
pub fn receive_shares ( self , shares : Vec < Scalar > ) -> Result < Signature , MusigError > { // Move out self's fields because `self.c` inside `map`'s closure would // lead to capturing `self` by reference, while we want // to move `self.counterparties` out of it. // See also RFC2229: https://github.com/rust-lang/rfcs/pull/2229 let challenge = self . c ; let multikey = & self . multikey ; // Check that all shares are valid. If so, create s from them. // s = sum(s_i), s_i = shares[i] let s = self . counterparties . into_iter ( ) . zip ( shares ) . map ( | ( counterparty , share ) | counterparty . sign ( share , challenge , multikey ) ) . sum :: < Result < _ , _ > > ( ) ? ; Ok ( Signature { s , R : self . R . compress ( ) , } ) }
Verify and assemble signature shares.
Verify and assemble signature shares .
self
shares
Vec<Scalar>
self
shares
Vec<Scalar>