1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//! This crate provides the Parasol processor for running programs over encrypted data. The general
//! workflow for using it is:
//! * Compile a program using Parasol-clang
//! * Encrypt our data and create an [`CallData`] object.
//! * Call [`FheComputer::run_program`], passing our key, program binary, the name of
//! the program we want to run, and args.
//! * Return or decrypt your program's result.
//!
//! # Example
//! ```ignore
//! use parasol_cpu::{run_program, ArgsBuilder};
//! use parasol_runtime::{ComputeKey, Encryption, PublicKey, SecretKey, fluent::Uint};
//!
//! // Embed the compiled Parasol add program into a constant.
//! const FHE_FILE: &[u8] = include_bytes!("../data/add");
//!
//! // Generate a secret key for the user. By default this ensures
//! // 128-bit security.
//! let secret_key =
//! SecretKey::generate_with_default_params();
//!
//! // Generate a compute key for the user. These keys are used for
//! // operations and do not give access to the plaintext data;
//! // therefore, this key can safely be shared with another party.
//! let compute_key =
//! ComputeKey::generate_with_default_params(
//! &secret_key,
//! );
//!
//! // Generate a public key that can be shared, allowing
//! // users to encrypt (but not decrypt) their data. By default
//! // this ensures 128-bit security.
//! let public_key =
//! PublicKey::generate_with_default_params();
//!
//! // Define the values we want to add. The values'
//! // sizes must match the Parasol C program's parameters
//! // when we encrypt them. Create the arguments and specify
//! // the return type
//! let enc = Encryption::default();
//! let args = ArgsBuilder::new()
//! .arg(UInt8::encrypt(2, &enc, &public_key))
//! .arg(UInt8::encrypt(7, &enc, &public_key))
//! .return_value::<UInt8>();
//!
//! // Run the program.
//! let encrypted_result = run_program(
//! compute_key.clone(),
//! FHE_FILE,
//! "add",
//! &args,
//! )
//! .unwrap();
//!
//! // Decrypt the result.
//! let result = encrypted_result.decrypt(&enc, &secret_key);
//!
//! println!("Encrypted {a} + {b} = {result}");
//! ```
pub use *;
pub use *;
pub use procFheComputer;
pub use procregister_names;
pub use IntoBytes;
pub use proc::*;
pub use *;