From 17ea255f4e51676a0448e4604f38d8bb2d77c882 Mon Sep 17 00:00:00 2001 From: rickwebiii Date: Thu, 12 May 2022 12:14:33 -0700 Subject: [PATCH] Add playground, rename seal->seal_fhe --- .github/workflows/playground.yml | 10 ++++++++-- .gitmodules | 2 +- Cargo.lock | 10 +++++----- Cargo.toml | 2 +- rust-playground | 2 +- seal/SEAL | 1 - {seal => seal_fhe}/Cargo.toml | 2 +- {seal => seal_fhe}/bindgen_wrapper.h | 0 {seal => seal_fhe}/build.rs | 0 {seal => seal_fhe}/src/bfv_evaluator.rs | 0 {seal => seal_fhe}/src/context.rs | 0 {seal => seal_fhe}/src/encoder.rs | 0 {seal => seal_fhe}/src/encryption_parameters.rs | 0 {seal => seal_fhe}/src/encryptor_decryptor.rs | 0 {seal => seal_fhe}/src/error.rs | 0 {seal => seal_fhe}/src/evaluator.rs | 0 {seal => seal_fhe}/src/evaluator_base.rs | 0 {seal => seal_fhe}/src/key_generator.rs | 0 {seal => seal_fhe}/src/lib.rs | 0 {seal => seal_fhe}/src/modulus.rs | 0 {seal => seal_fhe}/src/plaintext_ciphertext.rs | 0 {seal => seal_fhe}/tests/assumptions.rs | 2 +- {seal => seal_fhe}/tests/test_common.rs | 2 +- sunscreen/Cargo.toml | 4 ++-- sunscreen/src/error.rs | 6 +++--- sunscreen/src/lib.rs | 2 +- sunscreen/src/params.rs | 2 +- sunscreen/src/types/bfv/batched.rs | 4 ++-- sunscreen/src/types/bfv/fractional.rs | 2 +- sunscreen/src/types/bfv/signed.rs | 2 +- sunscreen_backend/Cargo.toml | 2 +- sunscreen_fhe_program/Cargo.toml | 2 +- sunscreen_fhe_program/src/lib.rs | 2 +- sunscreen_runtime/Cargo.toml | 2 +- sunscreen_runtime/src/array.rs | 2 +- sunscreen_runtime/src/error.rs | 6 +++--- sunscreen_runtime/src/keys.rs | 4 ++-- sunscreen_runtime/src/lib.rs | 8 ++++---- sunscreen_runtime/src/metadata.rs | 2 +- sunscreen_runtime/src/run.rs | 6 +++--- sunscreen_runtime/src/runtime.rs | 2 +- sunscreen_runtime/src/serialization.rs | 6 +++--- sunscreen_runtime/tests/serialization.rs | 2 +- 43 files changed, 53 insertions(+), 48 deletions(-) delete mode 160000 seal/SEAL rename {seal => seal_fhe}/Cargo.toml (96%) rename {seal => seal_fhe}/bindgen_wrapper.h (100%) rename {seal => seal_fhe}/build.rs (100%) rename {seal => seal_fhe}/src/bfv_evaluator.rs (100%) rename {seal => seal_fhe}/src/context.rs (100%) rename {seal => seal_fhe}/src/encoder.rs (100%) rename {seal => seal_fhe}/src/encryption_parameters.rs (100%) rename {seal => seal_fhe}/src/encryptor_decryptor.rs (100%) rename {seal => seal_fhe}/src/error.rs (100%) rename {seal => seal_fhe}/src/evaluator.rs (100%) rename {seal => seal_fhe}/src/evaluator_base.rs (100%) rename {seal => seal_fhe}/src/key_generator.rs (100%) rename {seal => seal_fhe}/src/lib.rs (100%) rename {seal => seal_fhe}/src/modulus.rs (100%) rename {seal => seal_fhe}/src/plaintext_ciphertext.rs (100%) rename {seal => seal_fhe}/tests/assumptions.rs (99%) rename {seal => seal_fhe}/tests/test_common.rs (98%) diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml index 29a1d54d5..fe683bf64 100644 --- a/.github/workflows/playground.yml +++ b/.github/workflows/playground.yml @@ -22,9 +22,10 @@ jobs: ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ + rust-playground/deployment/target rust-playground/ui/target rust-playground/ui/frontend/node_modules - key: ${{ runner.os }}-cargo-playground-${{ hashFiles('rust-playground/ui/Cargo.lock') }}-${{ hashFiles('rust-playground/ui/frontend/yarn.lock') }} + key: ${{ runner.os }}-cargo-playground-${{ hashFiles('rust-playground/ui/Cargo.lock') }}-${{ hashFiles('rust-playground/ui/frontend/yarn.lock') }}-${{ hashFiles('rust-playground/deployment/Cargo.lock') }} - name: Yarn install run: yarn install working-directory: ./rust-playground/ui/frontend @@ -34,10 +35,15 @@ jobs: - name: Cargo build run: cargo build --release --verbose working-directory: ./rust-playground/ui + - name: Build deployment app + run: cargo build --release --verbose + working-directory: ./rust-playground/deployment - name: Create EC2 instance - run: ./rust-playground/deployment/aws_launch_instance.sh + run: ./target/release/deployment + working-directory: ./rust-playground/deployment env: AWS_ACCESS_KEY_ID: ${{ secrets.DEPLOYMENT_AWS_ACCESS_KEY }} AWS_SECRET_ACCESS_KEY: ${{ secrets.DEPLOYMENT_AWS_ACCESS_KEY_SECRET }} EC2_KEY_PAIR: Deployment EC2_SECRET_KEY: ${{ secrets.DEPLOYMENT_KEYPAIR_SECRET_KEY }} + RUST_LOG: info diff --git a/.gitmodules b/.gitmodules index 110e5d614..f10192e75 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,5 +1,5 @@ [submodule "seal/SEAL"] - path = seal/SEAL + path = seal_fhe/SEAL url = git@github.com:rickwebiii/SEAL.git branch = wasm [submodule "emsdk/emsdk"] diff --git a/Cargo.lock b/Cargo.lock index 386018e20..1955a402f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1055,7 +1055,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] -name = "seal" +name = "seal_fhe" version = "0.4.0" dependencies = [ "bindgen", @@ -1183,7 +1183,7 @@ dependencies = [ "log", "num", "petgraph", - "seal", + "seal_fhe", "serde", "serde_json", "sunscreen_backend", @@ -1199,7 +1199,7 @@ dependencies = [ "env_logger", "log", "petgraph", - "seal", + "seal_fhe", "sunscreen_fhe_program", "sunscreen_runtime", ] @@ -1219,7 +1219,7 @@ name = "sunscreen_fhe_program" version = "0.4.0" dependencies = [ "petgraph", - "seal", + "seal_fhe", "serde", "serde_json", ] @@ -1235,7 +1235,7 @@ dependencies = [ "petgraph", "rayon", "rlp", - "seal", + "seal_fhe", "semver", "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index b37ee3442..5022330b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ members = [ "examples/chi_sq", "examples/dot_prod", "examples/pir", - "seal", + "seal_fhe", "sunscreen", "sunscreen_backend", "sunscreen_compiler_macros", diff --git a/rust-playground b/rust-playground index b5649ac18..893ae53d5 160000 --- a/rust-playground +++ b/rust-playground @@ -1 +1 @@ -Subproject commit b5649ac186f9e65291e69ee7afb7f4067d525d50 +Subproject commit 893ae53d539338e29c9564525185d79122f773aa diff --git a/seal/SEAL b/seal/SEAL deleted file mode 160000 index 783ef1458..000000000 --- a/seal/SEAL +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 783ef14587aac80160de7601fb0616c707244490 diff --git a/seal/Cargo.toml b/seal_fhe/Cargo.toml similarity index 96% rename from seal/Cargo.toml rename to seal_fhe/Cargo.toml index d17d9b995..8bdc0448f 100644 --- a/seal/Cargo.toml +++ b/seal_fhe/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "seal" +name = "seal_fhe" version = "0.4.0" edition = "2021" diff --git a/seal/bindgen_wrapper.h b/seal_fhe/bindgen_wrapper.h similarity index 100% rename from seal/bindgen_wrapper.h rename to seal_fhe/bindgen_wrapper.h diff --git a/seal/build.rs b/seal_fhe/build.rs similarity index 100% rename from seal/build.rs rename to seal_fhe/build.rs diff --git a/seal/src/bfv_evaluator.rs b/seal_fhe/src/bfv_evaluator.rs similarity index 100% rename from seal/src/bfv_evaluator.rs rename to seal_fhe/src/bfv_evaluator.rs diff --git a/seal/src/context.rs b/seal_fhe/src/context.rs similarity index 100% rename from seal/src/context.rs rename to seal_fhe/src/context.rs diff --git a/seal/src/encoder.rs b/seal_fhe/src/encoder.rs similarity index 100% rename from seal/src/encoder.rs rename to seal_fhe/src/encoder.rs diff --git a/seal/src/encryption_parameters.rs b/seal_fhe/src/encryption_parameters.rs similarity index 100% rename from seal/src/encryption_parameters.rs rename to seal_fhe/src/encryption_parameters.rs diff --git a/seal/src/encryptor_decryptor.rs b/seal_fhe/src/encryptor_decryptor.rs similarity index 100% rename from seal/src/encryptor_decryptor.rs rename to seal_fhe/src/encryptor_decryptor.rs diff --git a/seal/src/error.rs b/seal_fhe/src/error.rs similarity index 100% rename from seal/src/error.rs rename to seal_fhe/src/error.rs diff --git a/seal/src/evaluator.rs b/seal_fhe/src/evaluator.rs similarity index 100% rename from seal/src/evaluator.rs rename to seal_fhe/src/evaluator.rs diff --git a/seal/src/evaluator_base.rs b/seal_fhe/src/evaluator_base.rs similarity index 100% rename from seal/src/evaluator_base.rs rename to seal_fhe/src/evaluator_base.rs diff --git a/seal/src/key_generator.rs b/seal_fhe/src/key_generator.rs similarity index 100% rename from seal/src/key_generator.rs rename to seal_fhe/src/key_generator.rs diff --git a/seal/src/lib.rs b/seal_fhe/src/lib.rs similarity index 100% rename from seal/src/lib.rs rename to seal_fhe/src/lib.rs diff --git a/seal/src/modulus.rs b/seal_fhe/src/modulus.rs similarity index 100% rename from seal/src/modulus.rs rename to seal_fhe/src/modulus.rs diff --git a/seal/src/plaintext_ciphertext.rs b/seal_fhe/src/plaintext_ciphertext.rs similarity index 100% rename from seal/src/plaintext_ciphertext.rs rename to seal_fhe/src/plaintext_ciphertext.rs diff --git a/seal/tests/assumptions.rs b/seal_fhe/tests/assumptions.rs similarity index 99% rename from seal/tests/assumptions.rs rename to seal_fhe/tests/assumptions.rs index 73ba6e3e4..8ba8aef71 100644 --- a/seal/tests/assumptions.rs +++ b/seal_fhe/tests/assumptions.rs @@ -1,5 +1,5 @@ mod test_common; -use seal::Evaluator; +use seal_fhe::Evaluator; #[test] fn overflow_does_not_bleed_into_other_lanes() { diff --git a/seal/tests/test_common.rs b/seal_fhe/tests/test_common.rs similarity index 98% rename from seal/tests/test_common.rs rename to seal_fhe/tests/test_common.rs index 0edb5e8ef..af0fd3a7f 100644 --- a/seal/tests/test_common.rs +++ b/seal_fhe/tests/test_common.rs @@ -1,4 +1,4 @@ -use seal::*; +use seal_fhe::*; pub fn run_bfv_test(lane_bits: u32, degree: u64, test: F) where diff --git a/sunscreen/Cargo.toml b/sunscreen/Cargo.toml index df7cdcda0..ca84d1b32 100644 --- a/sunscreen/Cargo.toml +++ b/sunscreen/Cargo.toml @@ -18,7 +18,7 @@ sunscreen_compiler_macros = { version = "0.4", path = "../sunscreen_compiler_mac sunscreen_backend = { version = "0.4", path = "../sunscreen_backend", registry = "sunscreen" } sunscreen_fhe_program = { version = "0.4", path = "../sunscreen_fhe_program", registry = "sunscreen" } sunscreen_runtime = { version = "0.4", path = "../sunscreen_runtime", registry = "sunscreen" } -seal = { version = "0.4", path = "../seal", registry = "sunscreen" } +seal_fhe = { version = "0.4", path = "../seal_fhe", registry = "sunscreen" } serde = { version = "1.0.130", features = ["derive"] } [dev-dependencies] @@ -26,4 +26,4 @@ serde_json = "1.0.72" float-cmp = "0.9.0" [features] -hexl = ["seal/hexl"] \ No newline at end of file +hexl = ["seal_fhe/hexl"] \ No newline at end of file diff --git a/sunscreen/src/error.rs b/sunscreen/src/error.rs index 72ee20186..f837fe4f1 100644 --- a/sunscreen/src/error.rs +++ b/sunscreen/src/error.rs @@ -22,7 +22,7 @@ pub enum Error { /** * An internal error occurred in the SEAL library. */ - SealError(seal::Error), + SealError(seal_fhe::Error), /** * An Error occurred in the Sunscreen runtime. @@ -35,8 +35,8 @@ pub enum Error { FheProgramError(sunscreen_fhe_program::Error), } -impl From for Error { - fn from(err: seal::Error) -> Self { +impl From for Error { + fn from(err: seal_fhe::Error) -> Self { Self::SealError(err) } } diff --git a/sunscreen/src/lib.rs b/sunscreen/src/lib.rs index 87f9e08ee..adc90a98e 100644 --- a/sunscreen/src/lib.rs +++ b/sunscreen/src/lib.rs @@ -74,7 +74,7 @@ pub use clap::crate_version; pub use compiler::{Compiler, FheProgramFn}; pub use error::{Error, Result}; pub use params::PlainModulusConstraint; -pub use seal::Plaintext as SealPlaintext; +pub use seal_fhe::Plaintext as SealPlaintext; pub use sunscreen_compiler_macros::*; pub use sunscreen_fhe_program::{SchemeType, SecurityLevel}; pub use sunscreen_runtime::{ diff --git a/sunscreen/src/params.rs b/sunscreen/src/params.rs index 55033150a..413b74711 100644 --- a/sunscreen/src/params.rs +++ b/sunscreen/src/params.rs @@ -2,7 +2,7 @@ use crate::{Error, FheProgramFn, Result, SecurityLevel}; use log::{debug, trace}; -use seal::{ +use seal_fhe::{ BFVEvaluator, BFVScalarEncoder, BfvEncryptionParametersBuilder, CoefficientModulus, Context as SealContext, Decryptor, Encryptor, KeyGenerator, PlainModulus, }; diff --git a/sunscreen/src/types/bfv/batched.rs b/sunscreen/src/types/bfv/batched.rs index a8b2fbfe3..0530282bc 100644 --- a/sunscreen/src/types/bfv/batched.rs +++ b/sunscreen/src/types/bfv/batched.rs @@ -8,7 +8,7 @@ use crate::{ }, with_ctx, FheProgramInputTrait, InnerPlaintext, Literal, Params, Plaintext, WithContext, }; -use seal::{ +use seal_fhe::{ BFVEncoder, BfvEncryptionParametersBuilder, Context as SealContext, Modulus, Result as SealResult, }; @@ -626,7 +626,7 @@ impl LaneCount for Batched { mod tests { use super::*; use crate::SchemeType; - use seal::{CoefficientModulus, PlainModulus, SecurityLevel}; + use seal_fhe::{CoefficientModulus, PlainModulus, SecurityLevel}; #[test] fn can_roundtrip_encode_batched() { diff --git a/sunscreen/src/types/bfv/fractional.rs b/sunscreen/src/types/bfv/fractional.rs index b5af8097c..f7b00c6ab 100644 --- a/sunscreen/src/types/bfv/fractional.rs +++ b/sunscreen/src/types/bfv/fractional.rs @@ -1,4 +1,4 @@ -use seal::Plaintext as SealPlaintext; +use seal_fhe::Plaintext as SealPlaintext; use crate::types::{ ops::{ diff --git a/sunscreen/src/types/bfv/signed.rs b/sunscreen/src/types/bfv/signed.rs index 1853a71ad..d1757ab58 100644 --- a/sunscreen/src/types/bfv/signed.rs +++ b/sunscreen/src/types/bfv/signed.rs @@ -1,4 +1,4 @@ -use seal::Plaintext as SealPlaintext; +use seal_fhe::Plaintext as SealPlaintext; use crate::types::{ ops::{ diff --git a/sunscreen_backend/Cargo.toml b/sunscreen_backend/Cargo.toml index e03a02529..e57b8c97f 100644 --- a/sunscreen_backend/Cargo.toml +++ b/sunscreen_backend/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -seal = { version = "0.4", path = "../seal", registry = "sunscreen" } +seal_fhe = { version = "0.4", path = "../seal_fhe", registry = "sunscreen" } sunscreen_fhe_program = { version = "0.4", path = "../sunscreen_fhe_program", registry = "sunscreen" } sunscreen_runtime = { version = "0.4", path = "../sunscreen_runtime", registry = "sunscreen" } petgraph = "0.6.0" diff --git a/sunscreen_fhe_program/Cargo.toml b/sunscreen_fhe_program/Cargo.toml index 3efd8bef7..85e203d4a 100644 --- a/sunscreen_fhe_program/Cargo.toml +++ b/sunscreen_fhe_program/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] petgraph = { version = "0.6.0", features = ["serde-1"] } serde = { version = "1.0.130", features = ["derive"] } -seal = { version = "0.4", path = "../seal", registry = "sunscreen" } +seal_fhe = { version = "0.4", path = "../seal_fhe", registry = "sunscreen" } [dev-dependencies] serde_json = "1.0.71" \ No newline at end of file diff --git a/sunscreen_fhe_program/src/lib.rs b/sunscreen_fhe_program/src/lib.rs index b2f86e8f2..036e54dc8 100644 --- a/sunscreen_fhe_program/src/lib.rs +++ b/sunscreen_fhe_program/src/lib.rs @@ -24,7 +24,7 @@ use serde::{Deserialize, Serialize}; pub use error::*; pub use literal::*; pub use operation::*; -pub use seal::SecurityLevel; +pub use seal_fhe::SecurityLevel; use IRTransform::*; use TransformNodeIndex::*; diff --git a/sunscreen_runtime/Cargo.toml b/sunscreen_runtime/Cargo.toml index 325c12ecb..f97fc2fb6 100644 --- a/sunscreen_runtime/Cargo.toml +++ b/sunscreen_runtime/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" bincode = "1.3.3" crossbeam = "0.8.1" log = "0.4.14" -seal = { version = "0.4", path = "../seal", registry = "sunscreen" } +seal_fhe = { version = "0.4", path = "../seal_fhe", registry = "sunscreen" } sunscreen_fhe_program = { version = "0.4", path = "../sunscreen_fhe_program", registry = "sunscreen" } petgraph = "0.6.0" num_cpus = "1.13.0" diff --git a/sunscreen_runtime/src/array.rs b/sunscreen_runtime/src/array.rs index 9595ed72b..a182037a1 100644 --- a/sunscreen_runtime/src/array.rs +++ b/sunscreen_runtime/src/array.rs @@ -2,7 +2,7 @@ use crate::{ Error, FheProgramInputTrait, InnerPlaintext, NumCiphertexts, Params, Plaintext, Result, TryFromPlaintext, TryIntoPlaintext, Type, TypeName, TypeNameInstance, WithContext, }; -use seal::Plaintext as SealPlaintext; +use seal_fhe::Plaintext as SealPlaintext; impl TryIntoPlaintext for [T; N] where diff --git a/sunscreen_runtime/src/error.rs b/sunscreen_runtime/src/error.rs index 0c9b37408..2f1d970a8 100644 --- a/sunscreen_runtime/src/error.rs +++ b/sunscreen_runtime/src/error.rs @@ -13,7 +13,7 @@ pub enum Error { /** * An error occurred in the SEAL library. */ - SealError(seal::Error), + SealError(seal_fhe::Error), /** * Tried to run an Fhe Program that requires relinearization keys, but didn't provide any. @@ -144,8 +144,8 @@ impl From for Error { } } -impl From for Error { - fn from(err: seal::Error) -> Self { +impl From for Error { + fn from(err: seal_fhe::Error) -> Self { Self::SealError(err) } } diff --git a/sunscreen_runtime/src/keys.rs b/sunscreen_runtime/src/keys.rs index 43d9304ad..872058cd5 100644 --- a/sunscreen_runtime/src/keys.rs +++ b/sunscreen_runtime/src/keys.rs @@ -1,6 +1,6 @@ use crate::serialization::WithContext; -use seal::{ +use seal_fhe::{ GaloisKeys, PublicKey as SealPublicKey, RelinearizationKeys, SecretKey as SealSecretKey, }; use serde::{Deserialize, Serialize}; @@ -55,7 +55,7 @@ pub struct PrivateKey(pub(crate) SealSecretKey); mod tests { use super::*; use crate::*; - use seal::{CoefficientModulus, PlainModulus, SecurityLevel, ToBytes}; + use seal_fhe::{CoefficientModulus, PlainModulus, SecurityLevel, ToBytes}; use sunscreen_fhe_program::SchemeType; #[test] diff --git a/sunscreen_runtime/src/lib.rs b/sunscreen_runtime/src/lib.rs index cda171865..cce6a599f 100644 --- a/sunscreen_runtime/src/lib.rs +++ b/sunscreen_runtime/src/lib.rs @@ -19,16 +19,16 @@ pub use run::*; pub use runtime::*; pub use serialization::WithContext; -use seal::{Ciphertext as SealCiphertext, Plaintext as SealPlaintext}; +use seal_fhe::{Ciphertext as SealCiphertext, Plaintext as SealPlaintext}; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] /** - * The underlying backend implementation of a plaintext (e.g. SEAL's [`Plaintext`](seal::Plaintext)). + * The underlying backend implementation of a plaintext (e.g. SEAL's [`Plaintext`](seal_fhe::Plaintext)). */ pub enum InnerPlaintext { /** - * This plaintext wraps a SEAL [`Plaintext`](seal::Plaintext). + * This plaintext wraps a SEAL [`Plaintext`](seal_fhe::Plaintext). */ Seal(Vec>), } @@ -141,7 +141,7 @@ impl Plaintext { #[derive(Clone, Deserialize, Serialize)] /** - * The underlying backend implementation of a ciphertext (e.g SEAL's [`Ciphertext`](seal::Ciphertext)). + * The underlying backend implementation of a ciphertext (e.g SEAL's [`Ciphertext`](seal_fhe::Ciphertext)). */ pub enum InnerCiphertext { /** diff --git a/sunscreen_runtime/src/metadata.rs b/sunscreen_runtime/src/metadata.rs index e06f4959b..3f34dc848 100644 --- a/sunscreen_runtime/src/metadata.rs +++ b/sunscreen_runtime/src/metadata.rs @@ -1,5 +1,5 @@ use rlp::encode_list; -use seal::SecurityLevel; +use seal_fhe::SecurityLevel; pub use semver::Version; use serde::{ de::{self, Error as DeError, Visitor}, diff --git a/sunscreen_runtime/src/run.rs b/sunscreen_runtime/src/run.rs index 5ce65222b..6ab7f7d2a 100644 --- a/sunscreen_runtime/src/run.rs +++ b/sunscreen_runtime/src/run.rs @@ -10,7 +10,7 @@ use std::collections::VecDeque; #[cfg(not(target_arch = "wasm32"))] use std::sync::atomic::{AtomicUsize, Ordering}; -use seal::{Ciphertext, Error as SealError, Evaluator, GaloisKeys, Plaintext, RelinearizationKeys}; +use seal_fhe::{Ciphertext, Error as SealError, Evaluator, GaloisKeys, Plaintext, RelinearizationKeys}; #[derive(Debug, Clone, Copy, PartialEq)] /** @@ -75,7 +75,7 @@ impl From for FheProgramRunFailure { * guarantees. Call [`validate()`](sunscreen_fhe_program::FheProgram::validate()) to verify a program's correctness. * * # Remarks - * The input and outputs of this method are vectors containing [`seal::Ciphertext`] values, not the + * The input and outputs of this method are vectors containing [`seal_fhe::Ciphertext`] values, not the * high-level [`Ciphertext`] types. You must first unpack them from the high-level types. * * # Panics @@ -580,7 +580,7 @@ pub fn get_unary_operand(ir: &FheProgram, index: NodeIndex) -> NodeIndex { #[cfg(test)] mod tests { use super::*; - use seal::*; + use seal_fhe::*; use sunscreen_fhe_program::SchemeType; fn setup_scheme( diff --git a/sunscreen_runtime/src/runtime.rs b/sunscreen_runtime/src/runtime.rs index d186feabb..f43dfec38 100644 --- a/sunscreen_runtime/src/runtime.rs +++ b/sunscreen_runtime/src/runtime.rs @@ -7,7 +7,7 @@ use crate::{ }; use sunscreen_fhe_program::SchemeType; -use seal::{ +use seal_fhe::{ BFVEvaluator, BfvEncryptionParametersBuilder, Context as SealContext, Decryptor, Encryptor, KeyGenerator, Modulus, }; diff --git a/sunscreen_runtime/src/serialization.rs b/sunscreen_runtime/src/serialization.rs index c55bdf6e3..973e5b534 100644 --- a/sunscreen_runtime/src/serialization.rs +++ b/sunscreen_runtime/src/serialization.rs @@ -1,5 +1,5 @@ use crate::Params; -use seal::{BfvEncryptionParametersBuilder, Context, FromBytes, Modulus, ToBytes}; +use seal_fhe::{BfvEncryptionParametersBuilder, Context, FromBytes, Modulus, ToBytes}; use serde::{ de::{Deserializer, MapAccess, SeqAccess, Visitor}, ser::{Error, SerializeStruct, Serializer}, @@ -161,7 +161,7 @@ where } } -fn deserialize_with_params<'de, T>(params: &Params, data: &[u8]) -> Result +fn deserialize_with_params<'de, T>(params: &Params, data: &[u8]) -> Result where T: FromBytes, { @@ -169,7 +169,7 @@ where .coeff_modulus .iter() .map(|x| Modulus::new(*x)) - .collect::, seal::Error>>()?; + .collect::, seal_fhe::Error>>()?; let encryption_params = BfvEncryptionParametersBuilder::new() .set_coefficient_modulus(coeffs) diff --git a/sunscreen_runtime/tests/serialization.rs b/sunscreen_runtime/tests/serialization.rs index 87314c6da..c33cbe929 100644 --- a/sunscreen_runtime/tests/serialization.rs +++ b/sunscreen_runtime/tests/serialization.rs @@ -1,4 +1,4 @@ -use seal::{CoefficientModulus, SecurityLevel}; +use seal_fhe::{CoefficientModulus, SecurityLevel}; use sunscreen::types::bfv::Signed; use sunscreen_fhe_program::SchemeType; use sunscreen_runtime::{Ciphertext, Params, Runtime};