pub fn decrypt(_pk: &BdabePublicKey, _sk: &BdabeUserKey, _ct: &BdabeCiphertext) -> Option<Vec<u8>> {
    let _str_attr = _sk
        ._ska
        .iter()
        .map(|_values| _values._str.to_string())
        .collect::<Vec<_>>();
    return if traverse_str(&_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, _ct_j) in _ct._j.iter().enumerate() {
            if is_satisfiable(&_ct_j._str, &_sk._ska) {
                let _sk_sum = calc_satisfiable(&_ct_j._str, &_sk._ska);
                _msg = _ct_j._e1
                    * pairing(_ct_j._e2, _sk_sum.1)
                    * pairing(_sk_sum.0, _ct_j._e3)
                    * (pairing(_ct_j._e4, _sk._sk._u2) * pairing(_sk._sk._u1, _ct_j._e5)).inverse();
                break;
            }
        }
        // Decrypt plaintext using derived secret from Bdabe scheme
        decrypt_symmetric(&_msg, &_ct._ct)
    }
}
/// The decrypt algorithm of BDABE. Reconstructs the original plaintext data as Vec<u8>, given a BdabeCiphertext with a matching BdabeUserKey.
///
/// # Arguments
///
///	* `_pk` - A BdabePublicKey (PK), generated by the function setup()
///	* `_sk` - A BdabeUserKey (SK), generated by the function keygen()
///	* `_ct` - A BdabeCiphertext Ciphertext
///
The decrypt algorithm of BDABE. Reconstructs the original plaintext data as Vec, given a BdabeCiphertext with a matching BdabeUserKey.
The decrypt algorithm of BDABE . Reconstructs the original plaintext data as Vec given a BdabeCiphertext with a matching BdabeUserKey .
pub fn decrypt(_pk: &BdabePublicKey, _sk: &BdabeUserKey, _ct: &BdabeCiphertext) -> Option<Vec<u8>> {
    let _str_attr = _sk
        ._ska
        .iter()
        .map(|_values| _values._str.to_string())
        .collect::<Vec<_>>();
    return if traverse_str(&_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, _ct_j) in _ct._j.iter().enumerate() {
            if is_satisfiable(&_ct_j._str, &_sk._ska) {
                let _sk_sum = calc_satisfiable(&_ct_j._str, &_sk._ska);
                _msg = _ct_j._e1
                    * pairing(_ct_j._e2, _sk_sum.1)
                    * pairing(_sk_sum.0, _ct_j._e3)
                    * (pairing(_ct_j._e4, _sk._sk._u2) * pairing(_sk._sk._u1, _ct_j._e5)).inverse();
                break;
            }
        }
        // Decrypt plaintext using derived secret from Bdabe scheme
        decrypt_symmetric(&_msg, &_ct._ct)
    }
}
pub fn decrypt ( _pk : & BdabePublicKey , _sk : & BdabeUserKey , _ct : & BdabeCiphertext ) -> Option < Vec < u8 > > { let _str_attr = _sk . _ska . iter ( ) . map ( | _values | _values . _str . to_string ( ) ) . collect :: < Vec < _ > > ( ) ; return if traverse_str ( & _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 , _ct_j ) in _ct . _j . iter ( ) . enumerate ( ) { if is_satisfiable ( & _ct_j . _str , & _sk . _ska ) { let _sk_sum = calc_satisfiable ( & _ct_j . _str , & _sk . _ska ) ; _msg = _ct_j . _e1 * pairing ( _ct_j . _e2 , _sk_sum . 1 ) * pairing ( _sk_sum . 0 , _ct_j . _e3 ) * ( pairing ( _ct_j . _e4 , _sk . _sk . _u2 ) * pairing ( _sk . _sk . _u1 , _ct_j . _e5 ) ) . inverse ( ) ; break ; } } // Decrypt plaintext using derived secret from Bdabe scheme decrypt_symmetric ( & _msg , & _ct . _ct ) } }
The decrypt algorithm of BDABE.
The decrypt algorithm of BDABE .
_pk
&BdabePublicKey
_sk
&BdabeUserKey
_ct
&BdabeCiphertext
_pk
&BdabePublicKey
_sk
&BdabeUserKey
_ct
&BdabeCiphertext