pub fn wtp_verify_cust_close_message(channel_token: &ChannelToken<Bls12>, wpk: &secp256k1::PublicKey,
                                         close_msg: &Wallet<Bls12>, close_token: &cl::Signature<Bls12>) -> 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.channelId == H(channel_token.pk_c) &&
        let chan_token_cid = channel_token.compute_channel_id(); // util::hash_pubkey_to_fr::<Bls12>(&pk_c);
        let chan_token_wpk = util::hash_pubkey_to_fr::<Bls12>(&wpk);

        let cid_thesame = (close_msg.channelId == chan_token_cid);
        // (2) check that wpk matches what's in the close msg
        let wpk_thesame = (close_msg.wpk == chan_token_wpk);
        return cid_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
///
Used in open-channel WTP for validating that a close_token is a valid signature
Used in open - channel WTP for validating that a close_token is a valid signature
pub fn wtp_verify_cust_close_message(channel_token: &ChannelToken<Bls12>, wpk: &secp256k1::PublicKey,
                                         close_msg: &Wallet<Bls12>, close_token: &cl::Signature<Bls12>) -> 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.channelId == H(channel_token.pk_c) &&
        let chan_token_cid = channel_token.compute_channel_id(); // util::hash_pubkey_to_fr::<Bls12>(&pk_c);
        let chan_token_wpk = util::hash_pubkey_to_fr::<Bls12>(&wpk);
        let cid_thesame = (close_msg.channelId == chan_token_cid);
        // (2) check that wpk matches what's in the close msg
        let wpk_thesame = (close_msg.wpk == chan_token_wpk);
        return cid_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 ( channel_token : & ChannelToken < Bls12 > , wpk : & secp256k1 :: PublicKey , close_msg : & Wallet < Bls12 > , close_token : & cl :: Signature < Bls12 > ) -> 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.channelId == H(channel_token.pk_c) && let chan_token_cid = channel_token . compute_channel_id ( ) ; // util::hash_pubkey_to_fr::<Bls12>(&pk_c); let chan_token_wpk = util :: hash_pubkey_to_fr :: < Bls12 > ( & wpk ) ; let cid_thesame = ( close_msg . channelId == chan_token_cid ) ; // (2) check that wpk matches what's in the close msg let wpk_thesame = ( close_msg . wpk == chan_token_wpk ) ; return cid_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
Used in open - channel WTP for validating that a close_token is a valid signature
channel_token
&ChannelToken<Bls12>
wpk
&secp256k1::PublicKey
close_msg
&Wallet<Bls12>
close_token
&cl::Signature<Bls12>
channel_token
&ChannelToken<Bls12>
wpk
&secp256k1::PublicKey
close_msg
&Wallet<Bls12>
close_token
&cl::Signature<Bls12>