Fraunhofer-AISEC / rabe

rabe is an Attribute Based Encryption library, written in Rust
MIT License
76 stars 20 forks source link

Change some function signature #10

Closed Aya0wind closed 5 months ago

Aya0wind commented 2 years ago

Hi, I'm writing a C-FFI binding for this project, but i think some function signature is not reasonable enough.

Example

pub fn keygen(
    _pk: &KpAbePublicKey,
    _msk: &KpAbeMasterKey,
    _policy: &String,
    _language: PolicyLanguage,
) -> Result<KpAbeSecretKey, RabeError> 

the parameter _policy in this function is &String, but this function only need a immutable reference, i recommend use &str. Similarly, in this function:

pub fn encrypt(
    _gk: &Aw11GlobalKey,
    _pks: &Vec<Aw11PublicKey>,
    _policy: &String,
    _language: PolicyLanguage,
    _plaintext: &[u8],
) -> Result<Aw11Ciphertext, RabeError> 

the type of _pks should be &[Aw11PublicKey] instead of &Vec<Aw11PublicKey>

Reason

georgbramm commented 8 months ago

Still interested ? we could do that with the next update

georgbramm commented 5 months ago

should be fixed now