pub fn sign_child_key(
        &self,
        data: BigInt,
        chain: Blockchain,
    ) -> Result<(BigInt, BigInt, String)> {
        if self.get_remaining_r_vals(&chain) <= 0 {
            return Err(ProtocolError("Ran out of R values"));
        }
        let key = self.get_child_key(chain);
        let curve = match chain {
            Blockchain::Ethereum | Blockchain::Bitcoin => Curve::Secp256k1,
            Blockchain::NEO => Curve::Secp256r1,
        };
        // FIX ME: Right now the pools are under a global mutex. Make them managed
        let (sig, r) = nash_mpc::client::compute_presig(&key, &data, curve)
            .map_err(|_| ProtocolError("Error computing presignature"))?;
        // Track the fact that we now have one less R value
        self.decr_r_vals(chain);
        Ok((sig, r, key.public_key))
    }
/// Sign data hashed to `BigInt` with the MPC child key for the given `Blockchain`
Sign data hashed to `BigInt` with the MPC child key for the given `Blockchain`
Sign data hashed to ` BigInt ` with the MPC child key for the given ` Blockchain `
pub fn sign_child_key(
        &self,
        data: BigInt,
        chain: Blockchain,
    ) -> Result<(BigInt, BigInt, String)> {
        if self.get_remaining_r_vals(&chain) <= 0 {
            return Err(ProtocolError("Ran out of R values"));
        }
        let key = self.get_child_key(chain);
        let curve = match chain {
            Blockchain::Ethereum | Blockchain::Bitcoin => Curve::Secp256k1,
            Blockchain::NEO => Curve::Secp256r1,
        };
        // FIX ME: Right now the pools are under a global mutex. Make them managed
        let (sig, r) = nash_mpc::client::compute_presig(&key, &data, curve)
            .map_err(|_| ProtocolError("Error computing presignature"))?;
        // Track the fact that we now have one less R value
        self.decr_r_vals(chain);
        Ok((sig, r, key.public_key))
    }
pub fn sign_child_key ( & self , data : BigInt , chain : Blockchain , ) -> Result < ( BigInt , BigInt , String ) > { if self . get_remaining_r_vals ( & chain ) <= 0 { return Err ( ProtocolError ( " " ) ) ; } let key = self . get_child_key ( chain ) ; let curve = match chain { Blockchain :: Ethereum | Blockchain :: Bitcoin => Curve :: Secp256k1 , Blockchain :: NEO => Curve :: Secp256r1 , } ; // FIX ME: Right now the pools are under a global mutex. Make them managed let ( sig , r ) = nash_mpc :: client :: compute_presig ( & key , & data , curve ) . map_err ( | _ | ProtocolError ( " " ) ) ? ; // Track the fact that we now have one less R value self . decr_r_vals ( chain ) ; Ok ( ( sig , r , key . public_key ) ) }
Sign data hashed to `BigInt` with the MPC child key for the given `Blockchain`
Sign data hashed to ` BigInt ` with the MPC child key for the given ` Blockchain `
&self
data
BigInt
chain
Blockchain