pub fn keygen(
    _pk: &BdabePublicKey,
    _ska: &BdabeSecretAuthorityKey,
    _name: &String,
) -> BdabeUserKey {
    // random number generator
    let mut _rng = rand::thread_rng();
    let _r_u: Fr = _rng.gen();
    // return pk_u and sk_u
    BdabeUserKey {
        _sk: BdabeSecretUserKey {
            _u1: _ska._a1 + (_pk._p1 * _r_u),
            _u2: _ska._a2 + (_pk._p2 * _r_u),
        },
        _pk: BdabePublicUserKey {
            _u: _name.clone(),
            _u1: _pk._g1 * _r_u,
            _u2: _pk._g2 * _r_u,
        },
        _ska: Vec::new(),
    }
}
/// Sets up and generates a new User by creating a secret user key (SK).
/// The key is created for an user with a given "name".
/// It consists of a BdabeSecretUserKey and a BdabePublicUserKey as well as
/// an empty vector of BdabeSecretAttributeKeys.
///
/// # Arguments
///
///	* `_pk` - A BdabePublicKey (PK), generated by setup()
///	* `_ska` - A BdabeSecretAuthorityKey (SKauth), associated with an authority and generated by authgen()
///	* `_name` - The name of the user the key is associated with. Must be unique.
///
Sets up and generates a new User by creating a secret user key (SK).
The key is created for an user with a given "name".
It consists of a BdabeSecretUserKey and a BdabePublicUserKey as well as
an empty vector of BdabeSecretAttributeKeys.
Sets up and generates a new User by creating a secret user key ( SK ) . The key is created for an user with a given " name " . It consists of a BdabeSecretUserKey and a BdabePublicUserKey as well as an empty vector of BdabeSecretAttributeKeys .
pub fn keygen(
    _pk: &BdabePublicKey,
    _ska: &BdabeSecretAuthorityKey,
    _name: &String,
) -> BdabeUserKey {
    // random number generator
    let mut _rng = rand::thread_rng();
    let _r_u: Fr = _rng.gen();
    // return pk_u and sk_u
    BdabeUserKey {
        _sk: BdabeSecretUserKey {
            _u1: _ska._a1 + (_pk._p1 * _r_u),
            _u2: _ska._a2 + (_pk._p2 * _r_u),
        },
        _pk: BdabePublicUserKey {
            _u: _name.clone(),
            _u1: _pk._g1 * _r_u,
            _u2: _pk._g2 * _r_u,
        },
        _ska: Vec::new(),
    }
}
pub fn keygen ( _pk : & BdabePublicKey , _ska : & BdabeSecretAuthorityKey , _name : & String , ) -> BdabeUserKey { // random number generator let mut _rng = rand :: thread_rng ( ) ; let _r_u : Fr = _rng . gen ( ) ; // return pk_u and sk_u BdabeUserKey { _sk : BdabeSecretUserKey { _u1 : _ska . _a1 + ( _pk . _p1 * _r_u ) , _u2 : _ska . _a2 + ( _pk . _p2 * _r_u ) , } , _pk : BdabePublicUserKey { _u : _name . clone ( ) , _u1 : _pk . _g1 * _r_u , _u2 : _pk . _g2 * _r_u , } , _ska : Vec :: new ( ) , } }
Sets up and generates a new User by creating a secret user key (SK).
Sets up and generates a new User by creating a secret user key ( SK ) .
_pk
&BdabePublicKey
_ska
&BdabeSecretAuthorityKey
_name
&String
_pk
&BdabePublicKey
_ska
&BdabeSecretAuthorityKey
_name
&String