pub fn decrypt_symmetric(_msg: &bn::Gt, _iv_ct: &Vec<u8>) -> Option<Vec<u8>> {
    let mut _key: [u8; 32] = [0; 32];
    let mut _iv = _iv_ct.clone();
    let _data = _iv.split_off(16);
    let mut _sha = Sha3::sha3_256();
    let mut _rng = thread_rng();
    match serialize(&_msg) {
        Err(_) => return None,
        Ok(_serialized_msg) => {
            _sha.input(&_serialized_msg);
            _sha.result(&mut _key);
            let decrypted_data = decrypt_aes(&_data, &_key, &_iv).ok().unwrap();
            return Some(decrypted_data);
        }
    }
}
/// Key Encapsulation Mechanism (Decryption Function)
Key Encapsulation Mechanism (Decryption Function)
Key Encapsulation Mechanism ( Decryption Function )
pub fn decrypt_symmetric(_msg: &bn::Gt, _iv_ct: &Vec<u8>) -> Option<Vec<u8>> {
    let mut _key: [u8; 32] = [0; 32];
    let mut _iv = _iv_ct.clone();
    let _data = _iv.split_off(16);
    let mut _sha = Sha3::sha3_256();
    let mut _rng = thread_rng();
    match serialize(&_msg) {
        Err(_) => return None,
        Ok(_serialized_msg) => {
            _sha.input(&_serialized_msg);
            _sha.result(&mut _key);
            let decrypted_data = decrypt_aes(&_data, &_key, &_iv).ok().unwrap();
            return Some(decrypted_data);
        }
    }
}
pub fn decrypt_symmetric ( _msg : & bn :: Gt , _iv_ct : & Vec < u8 > ) -> Option < Vec < u8 > > { let mut _key : [ u8 ; 32 ] = [ 0 ; 32 ] ; let mut _iv = _iv_ct . clone ( ) ; let _data = _iv . split_off ( 16 ) ; let mut _sha = Sha3 :: sha3_256 ( ) ; let mut _rng = thread_rng ( ) ; match serialize ( & _msg ) { Err ( _ ) => return None , Ok ( _serialized_msg ) => { _sha . input ( & _serialized_msg ) ; _sha . result ( & mut _key ) ; let decrypted_data = decrypt_aes ( & _data , & _key , & _iv ) . ok ( ) . unwrap ( ) ; return Some ( decrypted_data ) ; } } }
Key Encapsulation Mechanism (Decryption Function)
Key Encapsulation Mechanism ( Decryption Function )
_msg
&bn::Gt
_iv_ct
&Vec<u8>
_msg
&bn::Gt
_iv_ct
&Vec<u8>