Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1,273 changes: 734 additions & 539 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ e3-utils = { version = "0.1.5", path = "./crates/utils" }
actix = "=0.13.5"
actix-web = "=4.11.0"
aes-gcm = "=0.10.3"
alloy = { version = "=1.0.23", features = ["node-bindings", "full"] }
alloy = { version = "=1.0.41", features = ["node-bindings", "full"] }
alloy-primitives = { version = "=1.3.0", default-features = false, features = [
"rlp",
"serde",
Expand Down Expand Up @@ -150,7 +150,7 @@ rand = "=0.8.5"
rayon = "=1.10.0"
regex = "=1.11.1"
reqwest = { version = "=0.12.22", features = ["json"] }
serde = { version = "=1.0.219", features = ["derive"] }
serde = { version = "=1.0.228", features = ["derive"] }
serde_json = "=1.0.141"
serial_test = "=3.2.0"
sled = "=0.34.7"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pnpm clean
</tr>
<tbody>
</table>
<!-- readme: contributors -end -->
<!-- readme: contributors-end -->

## Minimum Rust version

Expand Down
6 changes: 2 additions & 4 deletions crates/bfv-helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ fhe-traits.workspace = true
fhe.workspace = true
rand.workspace = true
anyhow.workspace = true
num-bigint.workspace = true
num-traits.workspace = true
fhe-util.workspace = true
greco.workspace = true
fhe-util = { git = "https://github.com/gnosisguild/fhe.rs" }
greco = { package = "zkfhe-greco", git = "https://github.com/gnosisguild/zkfhe-generator", version = "0.1.0"}

[dev-dependencies]
hex.workspace = true
14 changes: 3 additions & 11 deletions crates/bfv-helpers/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ use anyhow::{anyhow, Result};
use fhe::bfv::{Encoding, Plaintext, PublicKey};
use fhe::Error as FheError;
use fhe_traits::{DeserializeParametrized, FheEncoder, FheEncrypter, Serialize};
use greco::InputValidationVectors;
use num_bigint::BigInt;
use num_traits::Num;
use greco::vectors::GrecoVectors;
use rand::thread_rng;

/// Encrypt some data using BFV homomorphic encryption
Expand Down Expand Up @@ -106,7 +104,7 @@ where
.map_err(|e| anyhow!("Error encrypting data: {}", e))?;

// Create Greco input validation ZK proof
let input_val_vectors = InputValidationVectors::compute(
let input_val_vectors = GrecoVectors::compute(
&plaintext,
&u_rns,
&e0_rns,
Expand All @@ -117,13 +115,7 @@ where
)
.map_err(|e| anyhow!("Error computing input validation vectors: {}", e))?;

let zkp_modulus = BigInt::from_str_radix(
"21888242871839275222246405745257275088548364400416034343698204186575808495617",
10,
)
.unwrap();

let standard_input_val = input_val_vectors.standard_form(&zkp_modulus);
let standard_input_val = input_val_vectors.standard_form();

Ok(VerifiableEncryptionResult {
encrypted_data: cipher_text.to_bytes(),
Expand Down
Loading
Loading