fn build_signature_inputs(
    context: &SignWithEcdsaContext,
    quadruple: &PreSignatureQuadruple,
    key_transcript: &ecdsa::UnmaskedTranscript,
) -> Result<ThresholdEcdsaSigInputs, ThresholdEcdsaSigInputsCreationError> {
    // TODO: decide the appropriate conversion
    fn from_le_bytes(arr: &[u8]) -> Vec<u32> {
        let len = arr.len() / 4;
        let mut result = Vec::with_capacity(len);
        for i in 0..len {
            let mut dst = [0, 0, 0, 0];
            dst.copy_from_slice(&arr[(i * 4)..(i * 4 + 4)]);
            result.push(u32::from_le_bytes(dst));
        }
        result
    }
    let extended_derivation_path = ExtendedDerivationPath {
        caller: context.request.sender.into(),
        bip32_derivation_path: from_le_bytes(&context.derivation_path),
    };
    ThresholdEcdsaSigInputs::new(
        &extended_derivation_path,
        &context.message_hash,
        Id::from(context.pseudo_random_id),
        quadruple.clone(),
        key_transcript.clone().into(),
    )
}
/// Helper to build threshold signature inputs from the context and
/// the pre-signature quadruple
Helper to build threshold signature inputs from the context and
the pre-signature quadruple
Helper to build threshold signature inputs from the context and the pre - signature quadruple
fn build_signature_inputs(
    context: &SignWithEcdsaContext,
    quadruple: &PreSignatureQuadruple,
    key_transcript: &ecdsa::UnmaskedTranscript,
) -> Result<ThresholdEcdsaSigInputs, ThresholdEcdsaSigInputsCreationError> {
    // TODO: decide the appropriate conversion
    fn from_le_bytes(arr: &[u8]) -> Vec<u32> {
        let len = arr.len() / 4;
        let mut result = Vec::with_capacity(len);
        for i in 0..len {
            let mut dst = [0, 0, 0, 0];
            dst.copy_from_slice(&arr[(i * 4)..(i * 4 + 4)]);
            result.push(u32::from_le_bytes(dst));
        }
        result
    }
    let extended_derivation_path = ExtendedDerivationPath {
        caller: context.request.sender.into(),
        bip32_derivation_path: from_le_bytes(&context.derivation_path),
    };
    ThresholdEcdsaSigInputs::new(
        &extended_derivation_path,
        &context.message_hash,
        Id::from(context.pseudo_random_id),
        quadruple.clone(),
        key_transcript.clone().into(),
    )
}
fn build_signature_inputs ( context : & SignWithEcdsaContext , quadruple : & PreSignatureQuadruple , key_transcript : & ecdsa :: UnmaskedTranscript , ) -> Result < ThresholdEcdsaSigInputs , ThresholdEcdsaSigInputsCreationError > { // TODO: decide the appropriate conversion fn from_le_bytes ( arr : & [ u8 ] ) -> Vec < u32 > { let len = arr . len ( ) / 4 ; let mut result = Vec :: with_capacity ( len ) ; for i in 0 .. len { let mut dst = [ 0 , 0 , 0 , 0 ] ; dst . copy_from_slice ( & arr [ ( i * 4 ) .. ( i * 4 + 4 ) ] ) ; result . push ( u32 :: from_le_bytes ( dst ) ) ; } result } let extended_derivation_path = ExtendedDerivationPath { caller : context . request . sender . into ( ) , bip32_derivation_path : from_le_bytes ( & context . derivation_path ) , } ; ThresholdEcdsaSigInputs :: new ( & extended_derivation_path , & context . message_hash , Id :: from ( context . pseudo_random_id ) , quadruple . clone ( ) , key_transcript . clone ( ) . into ( ) , ) }
Helper to build threshold signature inputs from the context and
the pre-signature quadruple
Helper to build threshold signature inputs from the context and the pre - signature quadruple
context
&SignWithEcdsaContext
quadruple
&PreSignatureQuadruple
key_transcript
&ecdsa::UnmaskedTranscript
context
&SignWithEcdsaContext
quadruple
&PreSignatureQuadruple
key_transcript
&ecdsa::UnmaskedTranscript