Umbral-rs
umbral-rs is the implementation of the Umbral threshold proxy re-encryption scheme, built with Rust taking as reference the Python version createdby the Umbral authors.
Umbral consists of a Proxy Re-Encryption scheme, in which a data holder can delegate decryption rights to a data consumer for any encrypted text intended for him/her. It is carried out through a re-encryption process performed by a series of semi-trusted proxies. When a threshold of these proxies participates by performing the re-encryption and creating some shares, the consumer is able to combine these independent re-encryption shares and decrypt the original message using his private key.
Encrypt/Decrypt Example
use *;
let params = new_standard_params;
let alice = new;
let signer = new;
let bob = new;
let plaintext = b"Hello, umbral!".to_vec;
let = encrypt.unwrap;
capsule.set_correctness_keys;
let threshold = 2;
let nodes_number = 5;
let kfrags = generate_kfrags.unwrap;
for kfrag in kfrags
let plaintext_bob = decrypt.unwrap;
assert_eq!;
println!;
file documentation
the source code is in the src folder, the documentation is in the docs folder. Stated briefly, inside the src/internal folder there are the following files:
keys.rscontains theKeyPairstruct, which is used to generate the public and private keys.capsule.rscontains theCapsulestruct, which is used to encapsulate the ciphertext.kfrag.rscontains theKFragstruct, which is used to delegate the re-encryption rights.curve.rscontains theCurvestruct, which is used to generate the curve parameters.errors.rscontains theUmbralErrorenum, which is used to return the errors.scheme.rscontains the hashing functions used in the scheme.utils.rscontains tilities functions such aspoly_evalused to evaluate a polynomial at a point.
In the src folder there are the following files:
pre.rscontains the main functions to use the library, such asencrypt,decrypt,reencrypt,generate_kfrags, etc.lib.rscontains thepreludemodule, which is used to import the main functions of the library.main.rscontains themainfunction, which is used to run the tests.