pub fn request_authority_pk(
    _pk: &Mke08PublicKey,
    _a: &String,
    _sk_a: &Mke08SecretAuthorityKey,
) -> Option<Mke08PublicAttributeKey> {
    // if attribute a is from authority sk_a
    return if from_authority(_a, &_sk_a._a) {
        let exponent = blake2b_hash_fr(_a) * blake2b_hash_fr(&_sk_a._a) * _sk_a._r;
        // return PK and mke
        Some(Mke08PublicAttributeKey {
            _str: _a.clone(),
            _g1: _pk._g1 * exponent,
            _g2: _pk._g2 * exponent,
            _gt1: _pk._e_gg_y1.pow(exponent),
            _gt2: _pk._e_gg_y2.pow(exponent),
        })
    } else {
        None
    }
}
/// Sets up and generates a public Attribute Key for an Authority, if the attribute belongs to this auhtority
///
/// # Arguments
///
///	* `_pk` - A Public Key (PK), generated by the function setup()
///	* `_a` - The name of the attribute given as String.
///	* `_ska` - A Secret Authority Key (SKauth), generated by the function authgen()
///
Sets up and generates a public Attribute Key for an Authority, if the attribute belongs to this auhtority
Sets up and generates a public Attribute Key for an Authority if the attribute belongs to this auhtority
pub fn request_authority_pk(
    _pk: &Mke08PublicKey,
    _a: &String,
    _sk_a: &Mke08SecretAuthorityKey,
) -> Option<Mke08PublicAttributeKey> {
    // if attribute a is from authority sk_a
    return if from_authority(_a, &_sk_a._a) {
        let exponent = blake2b_hash_fr(_a) * blake2b_hash_fr(&_sk_a._a) * _sk_a._r;
        // return PK and mke
        Some(Mke08PublicAttributeKey {
            _str: _a.clone(),
            _g1: _pk._g1 * exponent,
            _g2: _pk._g2 * exponent,
            _gt1: _pk._e_gg_y1.pow(exponent),
            _gt2: _pk._e_gg_y2.pow(exponent),
        })
    } else {
        None
    }
}
pub fn request_authority_pk ( _pk : & Mke08PublicKey , _a : & String , _sk_a : & Mke08SecretAuthorityKey , ) -> Option < Mke08PublicAttributeKey > { // if attribute a is from authority sk_a return if from_authority ( _a , & _sk_a . _a ) { let exponent = blake2b_hash_fr ( _a ) * blake2b_hash_fr ( & _sk_a . _a ) * _sk_a . _r ; // return PK and mke Some ( Mke08PublicAttributeKey { _str : _a . clone ( ) , _g1 : _pk . _g1 * exponent , _g2 : _pk . _g2 * exponent , _gt1 : _pk . _e_gg_y1 . pow ( exponent ) , _gt2 : _pk . _e_gg_y2 . pow ( exponent ) , } ) } else { None } }
Sets up and generates a public Attribute Key for an Authority, if the attribute belongs to this auhtority
Sets up and generates a public Attribute Key for an Authority if the attribute belongs to this auhtority
_pk
&Mke08PublicKey
_a
&String
_sk_a
&Mke08SecretAuthorityKey
_pk
&Mke08PublicKey
_a
&String
_sk_a
&Mke08SecretAuthorityKey