pub fn wtp_verify_cust_close_message<E: Engine>(channel_token: &ChannelToken<E>, wpk: &secp256k1::PublicKey, close_msg: &wallet::Wallet<E>, close_token: &Signature<E>) -> bool {
        // close_msg => <pkc> || <wpk> || <balance-cust> || <balance-merch> || CLOSE
        // close_token = regular CL signature on close_msg
        // channel_token => <pk_c, CL_PK_m, pk_m, mpk, comParams>

        // (1) check that channel token and close msg are consistent (e.g., close_msg.pk_c == H(channel_token.pk_c) &&
        let pk_c = channel_token.pk_c.unwrap();
        let chan_token_pk_c = util::hash_pubkey_to_fr::<E>(&pk_c);
        let chan_token_wpk = util::hash_pubkey_to_fr::<E>(&wpk);

        let pkc_thesame = (close_msg.channelId == chan_token_pk_c);
        // (2) check that wpk matches what's in the close msg
        let wpk_thesame = (close_msg.wpk == chan_token_wpk);
        return pkc_thesame && wpk_thesame && channel_token.cl_pk_m.verify(&channel_token.mpk, &close_msg.as_fr_vec(), &close_token);
    }
///
/// Used in open-channel WTP for validating that a close_token is a valid signature under <
///
Used in open-channel WTP for validating that a close_token is a valid signature under <
Used in open - channel WTP for validating that a close_token is a valid signature under <
pub fn wtp_verify_cust_close_message<E: Engine>(channel_token: &ChannelToken<E>, wpk: &secp256k1::PublicKey, close_msg: &wallet::Wallet<E>, close_token: &Signature<E>) -> bool {
        // close_msg => <pkc> || <wpk> || <balance-cust> || <balance-merch> || CLOSE
        // close_token = regular CL signature on close_msg
        // channel_token => <pk_c, CL_PK_m, pk_m, mpk, comParams>
        // (1) check that channel token and close msg are consistent (e.g., close_msg.pk_c == H(channel_token.pk_c) &&
        let pk_c = channel_token.pk_c.unwrap();
        let chan_token_pk_c = util::hash_pubkey_to_fr::<E>(&pk_c);
        let chan_token_wpk = util::hash_pubkey_to_fr::<E>(&wpk);
        let pkc_thesame = (close_msg.channelId == chan_token_pk_c);
        // (2) check that wpk matches what's in the close msg
        let wpk_thesame = (close_msg.wpk == chan_token_wpk);
        return pkc_thesame && wpk_thesame && channel_token.cl_pk_m.verify(&channel_token.mpk, &close_msg.as_fr_vec(), &close_token);
    }
pub fn wtp_verify_cust_close_message < E : Engine > ( channel_token : & ChannelToken < E > , wpk : & secp256k1 :: PublicKey , close_msg : & wallet :: Wallet < E > , close_token : & Signature < E > ) -> bool { // close_msg => <pkc> || <wpk> || <balance-cust> || <balance-merch> || CLOSE // close_token = regular CL signature on close_msg // channel_token => <pk_c, CL_PK_m, pk_m, mpk, comParams> // (1) check that channel token and close msg are consistent (e.g., close_msg.pk_c == H(channel_token.pk_c) && let pk_c = channel_token . pk_c . unwrap ( ) ; let chan_token_pk_c = util :: hash_pubkey_to_fr :: < E > ( & pk_c ) ; let chan_token_wpk = util :: hash_pubkey_to_fr :: < E > ( & wpk ) ; let pkc_thesame = ( close_msg . channelId == chan_token_pk_c ) ; // (2) check that wpk matches what's in the close msg let wpk_thesame = ( close_msg . wpk == chan_token_wpk ) ; return pkc_thesame && wpk_thesame && channel_token . cl_pk_m . verify ( & channel_token . mpk , & close_msg . as_fr_vec ( ) , & close_token ) ; }
Used in open-channel WTP for validating that a close_token is a valid signature under <
Used in open - channel WTP for validating that a close_token is a valid signature under <
channel_token
&ChannelToken<E>
wpk
&secp256k1::PublicKey
close_msg
&wallet::Wallet<E>
close_token
&Signature<E>
channel_token
&ChannelToken<E>
wpk
&secp256k1::PublicKey
close_msg
&wallet::Wallet<E>
close_token
&Signature<E>