Runtime
To create a runtime, you simply call FheRuntime::new
, passing a Params
object. You get a params object from compiling an FHE program as we did in our example.
use sunscreen::{ fhe_program, types::{bfv::Signed, Cipher}, Compiler, FheRuntime, PublicKey }; #[fhe_program(scheme = "bfv")] fn noop() { } fn main() { let app = Compiler::new() .fhe_program(noop) .compile() .unwrap(); let runtime = FheRuntime::new(app.params()).unwrap(); }
Once you're created a runtime, you can:
Parameter compatibility
Note that to use artifacts produced by a runtime (e.g. ciphertexts, keys), they must have been produced under a runtime using exactly the same parameters. This situation may have ramifications if you're attempting to re-use ciphertexts across multiple FHE programs; those programs must be compiled with the same set of parameters.