Crates.io | concrete |
lib.rs | concrete |
version | 0.2.1 |
source | src |
created_at | 2020-02-14 13:06:00.342152 |
updated_at | 2022-11-16 10:44:24.818532 |
description | Concrete is a fully homomorphic encryption (FHE) library that implements Zama's variant of TFHE. |
homepage | https://www.zama.ai/concrete-framework |
repository | https://github.com/zama-ai/concrete |
max_upload_size | |
id | 208851 |
size | 259,746 |
concrete is a Rust crate (library) meant to abstract away the details of Fully Homomorphic Encryption (FHE) to enable non-cryptographers to build applications that use FHE.
FHE is a powerful cryptographic tool, which allows computation to be performed directly on encrypted data without needing to decrypt it first.
use concrete::{ConfigBuilder, generate_keys, set_server_key, FheUint8};
use concrete::prelude::*;
fn main() {
let config = ConfigBuilder::all_disabled()
.enable_default_uint8()
.build();
let (client_key, server_key) = generate_keys(config);
set_server_key(server_key);
let clear_a = 27u8;
let clear_b = 128u8;
let a = FheUint8::encrypt(clear_a, &client_key);
let b = FheUint8::encrypt(clear_b, &client_key);
let result = a + b;
let decrypted_result: u8 = result.decrypt(&client_key);
let clear_result = clear_a + clear_b;
assert_eq!(decrypted_result, clear_result);
}
This software is distributed under the BSD-3-Clause-Clear license with an exemption that gives rights to use our patents for research, evaluation and prototyping purposes, as well as for your personal projects.
If you want to use Concrete in a commercial product however, you will need to purchase a separate commercial licence.
If you have any questions, please contact us at hello@zama.ai
.