/// Combines the shares to decrypt the ciphertext.
Combines the shares to decrypt the ciphertext.
Combines the shares to decrypt the ciphertext .
pub fn decrypt<'a, T, I>(&self, shares: I, ct: &Ciphertext) -> Result<Vec<u8>>
    where
        I: IntoIterator<Item = (T, &'a DecryptionShare)>,
        T: IntoFr,
    {
        let samples = shares.into_iter().map(|(i, share)| (i, &share.0));
        //println!("samples {:?}", shares);
        let sid = interpolate(self.commit.degree(), samples)?;
        let gid = PEngine::pairing(sid,ct.0);
        let hash1 =  hash_g1(gid.to_string());
        let c = xor_with_hash_new(hash1.to_string(), &ct.1);
        //println!("mmm ###################### {:?}", c);
        //Ok(c)
        //Ok(xor_with_hash_new(hash1.to_string(), msg.as_ref())
        xor_with_hash(sid, &ct.1);
        Ok(c)
    }
pub fn decrypt < ' a , T , I > ( & self , shares : I , ct : & Ciphertext ) -> Result < Vec < u8 > > where I : IntoIterator < Item = ( T , & ' a DecryptionShare ) > , T : IntoFr , { let samples = shares . into_iter ( ) . map ( | ( i , share ) | ( i , & share . 0 ) ) ; //println!("samples {:?}", shares); let sid = interpolate ( self . commit . degree ( ) , samples ) ? ; let gid = PEngine :: pairing ( sid , ct . 0 ) ; let hash1 = hash_g1 ( gid . to_string ( ) ) ; let c = xor_with_hash_new ( hash1 . to_string ( ) , & ct . 1 ) ; //println!("mmm ###################### {:?}", c); //Ok(c) //Ok(xor_with_hash_new(hash1.to_string(), msg.as_ref()) xor_with_hash ( sid , & ct . 1 ) ; Ok ( c ) }
Combines the shares to decrypt the ciphertext.
Combines the shares to decrypt the ciphertext .
&self
shares
I
ct
&Ciphertext