pub fn add_attribute(
    _gk: &Aw11GlobalKey,
    _msk: &Aw11MasterKey,
    _attribute: &String,
    _sk: &mut Aw11SecretKey,
) {
    // if no attibutes or no gid
    if _attribute.is_empty() || _sk._gid.is_empty() {
        return;
    }
    let _h_g1 = blake2b_hash_g1(_gk._g1, &_sk._gid);
    let _auth_attribute = _msk
        ._attr
        .iter()
        .filter(|_attr| _attr.0 == _attribute.to_string())
        .nth(0)
        .unwrap();
    _sk._attr.push((
        _auth_attribute.0.clone().to_uppercase(),
        (_gk._g1 * _auth_attribute.1) + (_h_g1 * _auth_attribute.2),
    ));
}
/// This function does not create a new User key, but adds a new attribute to an already generated key (SK).
///
/// # Arguments
///
///	* `_gk` - A Global Parameters Key (GK), generated by setup()
///	* `_msk` - A Master Key (MK), associated with an authority and generated by authgen()
///	* `_attribute` - A String attribute that should be added to the already existing key (SK)
///	* `_sk` - The secret user key (SK)
This function does not create a new User key, but adds a new attribute to an already generated key (SK).
This function does not create a new User key but adds a new attribute to an already generated key ( SK ) .
pub fn add_attribute(
    _gk: &Aw11GlobalKey,
    _msk: &Aw11MasterKey,
    _attribute: &String,
    _sk: &mut Aw11SecretKey,
) {
    // if no attibutes or no gid
    if _attribute.is_empty() || _sk._gid.is_empty() {
        return;
    }
    let _h_g1 = blake2b_hash_g1(_gk._g1, &_sk._gid);
    let _auth_attribute = _msk
        ._attr
        .iter()
        .filter(|_attr| _attr.0 == _attribute.to_string())
        .nth(0)
        .unwrap();
    _sk._attr.push((
        _auth_attribute.0.clone().to_uppercase(),
        (_gk._g1 * _auth_attribute.1) + (_h_g1 * _auth_attribute.2),
    ));
}
pub fn add_attribute ( _gk : & Aw11GlobalKey , _msk : & Aw11MasterKey , _attribute : & String , _sk : & mut Aw11SecretKey , ) { // if no attibutes or no gid if _attribute . is_empty ( ) || _sk . _gid . is_empty ( ) { return ; } let _h_g1 = blake2b_hash_g1 ( _gk . _g1 , & _sk . _gid ) ; let _auth_attribute = _msk . _attr . iter ( ) . filter ( | _attr | _attr . 0 == _attribute . to_string ( ) ) . nth ( 0 ) . unwrap ( ) ; _sk . _attr . push ( ( _auth_attribute . 0 . clone ( ) . to_uppercase ( ) , ( _gk . _g1 * _auth_attribute . 1 ) + ( _h_g1 * _auth_attribute . 2 ) , ) ) ; }
This function does not create a new User key, but adds a new attribute to an already generated key (SK).
This function does not create a new User key but adds a new attribute to an already generated key ( SK ) .
_gk
&Aw11GlobalKey
_msk
&Aw11MasterKey
_attribute
&String
_sk
&mut Aw11SecretKey
_gk
&Aw11GlobalKey
_msk
&Aw11MasterKey
_attribute
&String
_sk
&mut Aw11SecretKey