Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0dd5a93
refactor: add user data encryption threshold circuit
cedoor Feb 3, 2026
47f3767
refactor: update crisp zk inputs code
cedoor Feb 3, 2026
697f862
chore: update default template cargo lock
cedoor Feb 3, 2026
2ff3281
refactor: re-use existing bits
cedoor Feb 4, 2026
2f388d3
refactor: use modular inverse from fhe.rs
cedoor Feb 4, 2026
f790d15
refactor: move greco logic to zk-helpers
cedoor Feb 4, 2026
f658ba7
refactor: change bit width calculation to use BigInt
cedoor Feb 4, 2026
644c2d0
refactor: replace calculate_bit_width with compute_pk_bit
cedoor Feb 4, 2026
910b9bf
refactor: move compute_pk_bit to utils
cedoor Feb 4, 2026
d134436
refactor: update user data encryption codegen configs
cedoor Feb 4, 2026
371dcdd
test: update import
cedoor Feb 4, 2026
d422b08
refactor: solve conflicts
cedoor Feb 4, 2026
58e11de
refactor: rename config and toml types
cedoor Feb 4, 2026
49bd44a
refactor: create to_json method for each circuit
cedoor Feb 4, 2026
e6529b3
refactor: add to_json method to each circuit computation
cedoor Feb 4, 2026
b9c5cd0
style: format rust code
cedoor Feb 4, 2026
87d0277
refactor: update serialization in crisp
cedoor Feb 4, 2026
5c7c0a7
refactor: remove unused functions from enclave-sdk
cedoor Feb 4, 2026
df40f48
test: update zk-input crisp tests
cedoor Feb 4, 2026
a98fee0
fix: compute max bound for pk and ct bit widths
cedoor Feb 4, 2026
9bd1fb9
refactor: update insecure threshold configs
cedoor Feb 4, 2026
e1af22d
refactor: revert wrong file addition
cedoor Feb 4, 2026
cfa4f6f
fix: use correct pk aggregation commitment
cedoor Feb 4, 2026
741cdc2
refactor: update enclave sdk to use correct inputs
cedoor Feb 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 4 additions & 110 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ members = [
"crates/fhe",
"crates/fhe-params",
"crates/fs",
"crates/greco-helpers",
"crates/indexer",
"crates/init",
"crates/keyshare",
Expand Down Expand Up @@ -88,7 +87,6 @@ e3-evm-helpers = { version = "0.1.8", path = "./crates/evm-helpers" }
e3-fhe = { version = "0.1.8", path = "./crates/fhe" }
e3-fhe-params = { version = "0.1.8", path = "./crates/fhe-params" }
e3-fs = { version = "0.1.8", path = "./crates/fs" }
e3-greco-helpers = { version = "0.1.8", path = "./crates/greco-helpers" }
e3-indexer = { version = "0.1.8", path = "./crates/indexer" }
e3-multithread = { version = "0.1.8", path = "./crates/multithread" }
e3-keyshare = { version = "0.1.8", path = "./crates/keyshare" }
Expand Down Expand Up @@ -148,7 +146,6 @@ futures = "=0.3.31"
futures-util = "=0.3.31"
glob = "=0.3.2"
git2 = "=0.20.2"
greco = { package = "e3-greco-generator", git = "https://github.com/gnosisguild/greco" }
hex = "=0.4.3"
lazy_static = "=1.5.0"
num = "=0.4.3"
Expand Down
42 changes: 20 additions & 22 deletions circuits/lib/src/configs/insecure/threshold.nr
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ use crate::core::threshold::user_data_encryption::Configs as UserDataEncryptionC
// Global configs for threshold insecure preset
pub global N: u32 = 512;
pub global L: u32 = 2;
pub global PLAINTEXT_MODULUS: Field = 10;
pub global PLAINTEXT_MODULUS: Field = 100;
pub global QIS: [Field; L] = [68719403009, 68719230977];
pub global Q_MOD_T_MOD_P: Field = 3;
pub global Q_MOD_T: Field = 3;
pub global Q_INVERSE_MOD_T: Field = 7;
pub global T_INV_MOD_Q: Field = 1416703358393105942938;
Expand Down Expand Up @@ -69,35 +68,34 @@ user_data_encryption (CIRCUIT 6)
-------------------------------------
************************************/

// user_data_encryption - bit parameters
pub global USER_DATA_ENCRYPTION_BIT_PK: u32 = 36;
pub global USER_DATA_ENCRYPTION_BIT_CT: u32 = 36;
pub global USER_DATA_ENCRYPTION_BIT_U: u32 = 2;
pub global USER_DATA_ENCRYPTION_BIT_E0: u32 = 6;
pub global USER_DATA_ENCRYPTION_BIT_E1: u32 = 6;
pub global USER_DATA_ENCRYPTION_BIT_K: u32 = 4;
pub global USER_DATA_ENCRYPTION_BIT_R1: u32 = 10;
pub global USER_DATA_ENCRYPTION_BIT_R2: u32 = 36;
pub global USER_DATA_ENCRYPTION_BIT_P1: u32 = 10;
pub global USER_DATA_ENCRYPTION_BIT_P2: u32 = 36;

// user_data_encryption - bounds
pub global USER_DATA_ENCRYPTION_K0IS: [Field; L] = [61847462708, 20615769293];
pub global USER_DATA_ENCRYPTION_BIT_PK: u32 = 35;
pub global USER_DATA_ENCRYPTION_BIT_CT: u32 = 35;
pub global USER_DATA_ENCRYPTION_BIT_U: u32 = 1;
pub global USER_DATA_ENCRYPTION_BIT_E0: u32 = 5;
pub global USER_DATA_ENCRYPTION_BIT_E1: u32 = 5;
pub global USER_DATA_ENCRYPTION_BIT_K: u32 = 6;
pub global USER_DATA_ENCRYPTION_BIT_R1: u32 = 9;
pub global USER_DATA_ENCRYPTION_BIT_R2: u32 = 35;
pub global USER_DATA_ENCRYPTION_BIT_P1: u32 = 9;
pub global USER_DATA_ENCRYPTION_BIT_P2: u32 = 35;

pub global USER_DATA_ENCRYPTION_Q_MOD_T_MOD_P: Field =
21888242871839275222246405745257275088548364400416034343698204186575808495610;
pub global USER_DATA_ENCRYPTION_K0IS: [Field; L] = [61160268678, 8933500027];
pub global USER_DATA_ENCRYPTION_PK_BOUNDS: [Field; L] = [34359701504, 34359615488];
pub global USER_DATA_ENCRYPTION_E0_BOUND: Field = 20;
pub global USER_DATA_ENCRYPTION_E1_BOUND: Field = 20;
pub global USER_DATA_ENCRYPTION_U_BOUND: Field = 1;
pub global USER_DATA_ENCRYPTION_K1_LOW_BOUND: Field = 5;
pub global USER_DATA_ENCRYPTION_K1_UP_BOUND: Field = 4;
pub global USER_DATA_ENCRYPTION_R1_LOW_BOUNDS: [Field; L] = [261, 258];
pub global USER_DATA_ENCRYPTION_R1_UP_BOUNDS: [Field; L] = [260, 258];
pub global USER_DATA_ENCRYPTION_K1_LOW_BOUND: Field = 50;
pub global USER_DATA_ENCRYPTION_K1_UP_BOUND: Field = 49;
pub global USER_DATA_ENCRYPTION_R1_LOW_BOUNDS: [Field; L] = [301, 263];
pub global USER_DATA_ENCRYPTION_R1_UP_BOUNDS: [Field; L] = [300, 263];
pub global USER_DATA_ENCRYPTION_R2_BOUNDS: [Field; L] = [34359701504, 34359615488];
pub global USER_DATA_ENCRYPTION_P1_BOUNDS: [Field; L] = [256, 256];
pub global USER_DATA_ENCRYPTION_P2_BOUNDS: [Field; L] = [34359701504, 34359615488];

// greco - configs
pub global USER_DATA_ENCRYPTION_CONFIGS: UserDataEncryptionConfigs<N, L> = UserDataEncryptionConfigs::new(
Q_MOD_T,
USER_DATA_ENCRYPTION_Q_MOD_T_MOD_P,
QIS,
USER_DATA_ENCRYPTION_K0IS,
USER_DATA_ENCRYPTION_PK_BOUNDS,
Expand Down
1 change: 0 additions & 1 deletion crates/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ COPY --from=evm-builder /build/packages/enclave-contracts/deployed_contracts.jso
# find crates/* -name "Cargo.toml" -not -path "*/support/*" -printf "COPY %p %p\n" | sed 's|COPY \(.*\) crates/|COPY \1 ./|'
COPY crates/aggregator/Cargo.toml ./aggregator/Cargo.toml
COPY crates/bfv-client/Cargo.toml ./bfv-client/Cargo.toml
COPY crates/greco-helpers/Cargo.toml ./greco-helpers/Cargo.toml
COPY crates/cli/Cargo.toml ./cli/Cargo.toml
COPY crates/ciphernode-builder/Cargo.toml ./ciphernode-builder/Cargo.toml
COPY crates/compute-provider/Cargo.toml ./compute-provider/Cargo.toml
Expand Down
4 changes: 1 addition & 3 deletions crates/bfv-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ repository = "https://github.com/gnosisguild/enclave/crates/bfv-client"
[dependencies]
anyhow.workspace = true
e3-fhe-params = { workspace = true }
e3-greco-helpers = { workspace = true }
e3-zk-helpers = { workspace = true }
fhe.workspace = true
fhe-traits.workspace = true
greco = { package = "zkfhe-greco", git = "https://github.com/gnosisguild/zkfhe-generator" }
rand.workspace = true
thiserror = { workspace = true }
e3-polynomial = { workspace = true }
e3-zk-helpers = { workspace = true }
Loading
Loading