fn challenge(public_key: &PK, t: &TTriplets, ciphertext: &Ciphertext, X: &GE) -> BigInt {
        use crate::curv::arithmetic::traits::Converter;
        let hash256 = HSha256::create_hash(&[
            // hash the statement i.e. the discrete log of Q is encrypted in (c1,c2) under encryption key h.
            &X.bytes_compressed_to_big_int(),
            &BigInt::from(ciphertext.c1.to_bytes().as_ref()),
            &BigInt::from(ciphertext.c2.to_bytes().as_ref()),
            &BigInt::from(public_key.0.to_bytes().as_ref()),
            // hash Sigma protocol commitments
            &BigInt::from(t.t1.to_bytes().as_ref()),
            &BigInt::from(t.t2.to_bytes().as_ref()),
            &t.T.bytes_compressed_to_big_int(),
        ]);

        let hash128 = &BigInt::to_vec(&hash256)[..SECURITY_PARAMETER / 8];
        BigInt::from(hash128)
    }
/// Compute the Fiat-Shamir challenge for the proof.
Compute the Fiat-Shamir challenge for the proof.
Compute the Fiat - Shamir challenge for the proof .
fn challenge(public_key: &PK, t: &TTriplets, ciphertext: &Ciphertext, X: &GE) -> BigInt {
        use crate::curv::arithmetic::traits::Converter;
        let hash256 = HSha256::create_hash(&[
            // hash the statement i.e. the discrete log of Q is encrypted in (c1,c2) under encryption key h.
            &X.bytes_compressed_to_big_int(),
            &BigInt::from(ciphertext.c1.to_bytes().as_ref()),
            &BigInt::from(ciphertext.c2.to_bytes().as_ref()),
            &BigInt::from(public_key.0.to_bytes().as_ref()),
            // hash Sigma protocol commitments
            &BigInt::from(t.t1.to_bytes().as_ref()),
            &BigInt::from(t.t2.to_bytes().as_ref()),
            &t.T.bytes_compressed_to_big_int(),
        ]);
        let hash128 = &BigInt::to_vec(&hash256)[..SECURITY_PARAMETER / 8];
        BigInt::from(hash128)
    }
fn challenge ( public_key : & PK , t : & TTriplets , ciphertext : & Ciphertext , X : & GE ) -> BigInt { use crate :: curv :: arithmetic :: traits :: Converter ; let hash256 = HSha256 :: create_hash ( & [ // hash the statement i.e. the discrete log of Q is encrypted in (c1,c2) under encryption key h. & X . bytes_compressed_to_big_int ( ) , & BigInt :: from ( ciphertext . c1 . to_bytes ( ) . as_ref ( ) ) , & BigInt :: from ( ciphertext . c2 . to_bytes ( ) . as_ref ( ) ) , & BigInt :: from ( public_key . 0 . to_bytes ( ) . as_ref ( ) ) , // hash Sigma protocol commitments & BigInt :: from ( t . t1 . to_bytes ( ) . as_ref ( ) ) , & BigInt :: from ( t . t2 . to_bytes ( ) . as_ref ( ) ) , & t . T . bytes_compressed_to_big_int ( ) , ] ) ; let hash128 = & BigInt :: to_vec ( & hash256 ) [ .. SECURITY_PARAMETER / 8 ] ; BigInt :: from ( hash128 ) }
Compute the Fiat-Shamir challenge for the proof.
Compute the Fiat - Shamir challenge for the proof .
public_key
&PK
t
&TTriplets
ciphertext
&Ciphertext
X
&GE
public_key
&PK
t
&TTriplets
ciphertext
&Ciphertext
X
&GE