pub fn decrypt(_pk: &Mke08PublicKey, _sk: &Mke08UserKey, _ct: &Mke08Ciphertext) -> Option<Vec<u8>> {
    let _attr = _sk._sk_a
        .iter()
        .map(|triple| {
            let _a = triple.clone();
            _a._str.to_string()
        })
        .collect::<Vec<_>>();
    return if traverse_str(&_attr, &_ct._policy) == false {
        //println!("Error: attributes in sk do not match policy in ct.");
        None
    } else {
        let mut _msg = Gt::one();
        for (_i, _e_j) in _ct._e.iter().enumerate() {
            if is_satisfiable(&_e_j._str, &_sk._sk_a) {
                let _sk_sum = calc_satisfiable(&_e_j._str, &_sk._sk_a);
                _msg = _e_j._j1 * _e_j._j2 * pairing(_e_j._j3, _sk_sum.1) *
                    pairing(_sk_sum.0, _e_j._j4) *
                    (pairing(_e_j._j5, _sk._sk_u._sk_g2) * pairing(_sk._sk_u._sk_g1, _e_j._j6))
                        .inverse();
                break;
            }
        }
        // Decrypt plaintext using derived secret from mke08 scheme
        decrypt_symmetric(&_msg, &_ct._ct)
    }
}
/// The decrypt algorithm of MKE08. Reconstructs the original plaintext data as Vec<u8>, given a Mke08PublicKey, a Mke08Ciphertext and a matching Mke08UserKey.
///
/// # Arguments
///
///	* `_pk` - A Mke08PublicKey (PK), generated by the function setup()
///	* `_sk` - A Mke08UserKey (SK), generated by the function keygen()
///	* `_ct` - A Mke08Ciphertext
///	* `_policy` - An access policy given as JSON String
///
The decrypt algorithm of MKE08. Reconstructs the original plaintext data as Vec, given a Mke08PublicKey, a Mke08Ciphertext and a matching Mke08UserKey.
The decrypt algorithm of MKE08 . Reconstructs the original plaintext data as Vec given a Mke08PublicKey a Mke08Ciphertext and a matching Mke08UserKey .
pub fn decrypt(_pk: &Mke08PublicKey, _sk: &Mke08UserKey, _ct: &Mke08Ciphertext) -> Option<Vec<u8>> {
    let _attr = _sk._sk_a
        .iter()
        .map(|triple| {
            let _a = triple.clone();
            _a._str.to_string()
        })
        .collect::<Vec<_>>();
    return if traverse_str(&_attr, &_ct._policy) == false {
        //println!("Error: attributes in sk do not match policy in ct.");
        None
    } else {
        let mut _msg = Gt::one();
        for (_i, _e_j) in _ct._e.iter().enumerate() {
            if is_satisfiable(&_e_j._str, &_sk._sk_a) {
                let _sk_sum = calc_satisfiable(&_e_j._str, &_sk._sk_a);
                _msg = _e_j._j1 * _e_j._j2 * pairing(_e_j._j3, _sk_sum.1) *
                    pairing(_sk_sum.0, _e_j._j4) *
                    (pairing(_e_j._j5, _sk._sk_u._sk_g2) * pairing(_sk._sk_u._sk_g1, _e_j._j6))
                        .inverse();
                break;
            }
        }
        // Decrypt plaintext using derived secret from mke08 scheme
        decrypt_symmetric(&_msg, &_ct._ct)
    }
}
pub fn decrypt ( _pk : & Mke08PublicKey , _sk : & Mke08UserKey , _ct : & Mke08Ciphertext ) -> Option < Vec < u8 > > { let _attr = _sk . _sk_a . iter ( ) . map ( | triple | { let _a = triple . clone ( ) ; _a . _str . to_string ( ) } ) . collect :: < Vec < _ > > ( ) ; return if traverse_str ( & _attr , & _ct . _policy ) == false { //println!("Error: attributes in sk do not match policy in ct."); None } else { let mut _msg = Gt :: one ( ) ; for ( _i , _e_j ) in _ct . _e . iter ( ) . enumerate ( ) { if is_satisfiable ( & _e_j . _str , & _sk . _sk_a ) { let _sk_sum = calc_satisfiable ( & _e_j . _str , & _sk . _sk_a ) ; _msg = _e_j . _j1 * _e_j . _j2 * pairing ( _e_j . _j3 , _sk_sum . 1 ) * pairing ( _sk_sum . 0 , _e_j . _j4 ) * ( pairing ( _e_j . _j5 , _sk . _sk_u . _sk_g2 ) * pairing ( _sk . _sk_u . _sk_g1 , _e_j . _j6 ) ) . inverse ( ) ; break ; } } // Decrypt plaintext using derived secret from mke08 scheme decrypt_symmetric ( & _msg , & _ct . _ct ) } }
The decrypt algorithm of MKE08.
The decrypt algorithm of MKE08 .
_pk
&Mke08PublicKey
_sk
&Mke08UserKey
_ct
&Mke08Ciphertext
_pk
&Mke08PublicKey
_sk
&Mke08UserKey
_ct
&Mke08Ciphertext