pub fn wtp_verify_merch_close_message<E: Engine>(channel_token: &ChannelToken<E>, merch_close: &ChannelcloseM) -> bool {
        let secp = secp256k1::Secp256k1::verification_only();
        let mut msg = Vec::new();
        msg.extend(merch_close.address.as_bytes());
        if !merch_close.revoke.is_none() {
            // serialize signature in DER format
            let r = merch_close.revoke.unwrap().serialize_der().to_vec();
            msg.extend(r);
        }
        let msg2 = secp256k1::Message::from_slice(&hash_to_slice(&msg)).unwrap();
        // verify that merch sig is valid with respect to dest_address
        return secp.verify(&msg2, &merch_close.signature, &channel_token.pk_m).is_ok();
    }
///
/// Used in merch-close WTP for validating that merch_sig is a valid signature under <merch_pk> on <dest_addr || revoke-token> message
///
Used in merch-close WTP for validating that merch_sig is a valid signature under  on  message
Used in merch - close WTP for validating that merch_sig is a valid signature under on message
pub fn wtp_verify_merch_close_message<E: Engine>(channel_token: &ChannelToken<E>, merch_close: &ChannelcloseM) -> bool {
        let secp = secp256k1::Secp256k1::verification_only();
        let mut msg = Vec::new();
        msg.extend(merch_close.address.as_bytes());
        if !merch_close.revoke.is_none() {
            // serialize signature in DER format
            let r = merch_close.revoke.unwrap().serialize_der().to_vec();
            msg.extend(r);
        }
        let msg2 = secp256k1::Message::from_slice(&hash_to_slice(&msg)).unwrap();
        // verify that merch sig is valid with respect to dest_address
        return secp.verify(&msg2, &merch_close.signature, &channel_token.pk_m).is_ok();
    }
pub fn wtp_verify_merch_close_message < E : Engine > ( channel_token : & ChannelToken < E > , merch_close : & ChannelcloseM ) -> bool { let secp = secp256k1 :: Secp256k1 :: verification_only ( ) ; let mut msg = Vec :: new ( ) ; msg . extend ( merch_close . address . as_bytes ( ) ) ; if ! merch_close . revoke . is_none ( ) { // serialize signature in DER format let r = merch_close . revoke . unwrap ( ) . serialize_der ( ) . to_vec ( ) ; msg . extend ( r ) ; } let msg2 = secp256k1 :: Message :: from_slice ( & hash_to_slice ( & msg ) ) . unwrap ( ) ; // verify that merch sig is valid with respect to dest_address return secp . verify ( & msg2 , & merch_close . signature , & channel_token . pk_m ) . is_ok ( ) ; }
Used in merch-close WTP for validating that merch_sig is a valid signature under <merch_pk> on <dest_addr || revoke-token> message
Used in merch - close WTP for validating that merch_sig is a valid signature under <merch_pk > on <dest_addr || revoke - token > message
channel_token
&ChannelToken<E>
merch_close
&ChannelcloseM
channel_token
&ChannelToken<E>
merch_close
&ChannelcloseM