mirror of
https://github.com/zama-ai/concrete.git
synced 2026-04-17 03:00:54 -04:00
docs(frontend): vectorizing
This commit is contained in:
@@ -83,13 +83,13 @@ fn main() -> Result<(), Box<dyn std::error::Error>>{
|
||||
|
||||
i = i + 1;
|
||||
|
||||
// Pick random UInt8
|
||||
// FIXME: remove the modulo 128
|
||||
// Pick random UInt8's
|
||||
let mut rng = rand::thread_rng();
|
||||
let mut vec_clear = Vec::new();
|
||||
let mut j = 0;
|
||||
|
||||
while j < nb_parameters_in_function {
|
||||
// FIXME: remove the modulo 128
|
||||
let clear: u8 = rng.gen_range(0..128);
|
||||
|
||||
println!("Encrypting: {clear}");
|
||||
@@ -112,12 +112,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>>{
|
||||
.arg("run")
|
||||
.arg("-k")
|
||||
.arg("server_dir/concrete_keyset.txt")
|
||||
.arg("-c1")
|
||||
.arg("server_dir/ciphertext_0.txt")
|
||||
.arg("-c2")
|
||||
.arg("server_dir/ciphertext_1.txt")
|
||||
.arg("-c3")
|
||||
.arg("server_dir/ciphertext_2.txt")
|
||||
.arg("-c")
|
||||
.arg("server_dir/ciphertext_0.txt server_dir/ciphertext_1.txt server_dir/ciphertext_2.txt")
|
||||
.arg("-o")
|
||||
.arg("server_dir/ciphertext_r.txt")
|
||||
.output()
|
||||
|
||||
@@ -143,13 +143,11 @@ def keygen(secret_key: str, concrete_keyset_path: str):
|
||||
|
||||
|
||||
@cli.command()
|
||||
@click.option("-c1", "--rust-ct-1", type=str, required=True)
|
||||
@click.option("-c2", "--rust-ct-2", type=str, required=True)
|
||||
@click.option("-c3", "--rust-ct-3", type=str, required=True)
|
||||
@click.option("-c", "--rust-ct", type=str, required=True)
|
||||
@click.option("-o", "--output-rust-ct", type=str, required=True)
|
||||
@click.option("-k", "--concrete-keyset-path", type=str, required=True)
|
||||
# This is the actual FHE computation, on the server side
|
||||
def run(rust_ct_1: str, rust_ct_2: str, rust_ct_3: str, output_rust_ct: str, concrete_keyset_path: str):
|
||||
def run(rust_ct: str, output_rust_ct: str, concrete_keyset_path: str):
|
||||
"""Run circuit"""
|
||||
circuit, tfhers_bridge = compile_concrete_function()
|
||||
|
||||
@@ -158,6 +156,8 @@ def run(rust_ct_1: str, rust_ct_2: str, rust_ct_3: str, output_rust_ct: str, con
|
||||
|
||||
circuit.client.keys.load(concrete_keyset_path)
|
||||
|
||||
rust_ct_1, rust_ct_2, rust_ct_3 = rust_ct.split()
|
||||
|
||||
tfhers_uint8_x = read_var_from_file(tfhers_bridge, rust_ct_1, input_idx=0)
|
||||
tfhers_uint8_y = read_var_from_file(tfhers_bridge, rust_ct_2, input_idx=1)
|
||||
tfhers_uint8_z = read_var_from_file(tfhers_bridge, rust_ct_3, input_idx=2)
|
||||
|
||||
Reference in New Issue
Block a user