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 change: 1 addition & 0 deletions Cargo.lock

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

5 changes: 3 additions & 2 deletions crates/multithread/src/multithread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use e3_trbfv::gen_esi_sss::gen_esi_sss;
use e3_trbfv::gen_pk_share_and_sk_sss::gen_pk_share_and_sk_sss;
use e3_trbfv::{TrBFVError, TrBFVRequest, TrBFVResponse};
use e3_utils::SharedRng;
use e3_zk_helpers::circuits::dkg::pk::circuit::PkCircuit;
use e3_zk_helpers::circuits::dkg::pk::circuit::{PkCircuit, PkCircuitInput};
use e3_zk_prover::{Provable, ZkBackend, ZkProver};
use fhe::bfv::PublicKey;
use fhe_traits::DeserializeParametrized;
Expand Down Expand Up @@ -357,6 +357,7 @@ fn handle_pk_bfv_proof(
})?;

let circuit = PkCircuit;
let circuit_input = PkCircuitInput { public_key: pk_bfv };
let e3_id_str = request.e3_id.to_string();
let preset_counterpart = req
.params_preset
Expand All @@ -365,7 +366,7 @@ fn handle_pk_bfv_proof(
// But here we have to pass the InsecureThreshold512 preset because the underlaying witness generator
// builds both params, but will only use the DKG one
let proof = circuit
.prove(prover, &preset_counterpart, &pk_bfv, &e3_id_str)
.prove(prover, &preset_counterpart, &circuit_input, &e3_id_str)
.map_err(|e| {
ComputeRequestError::new(
ComputeRequestErrorKind::Zk(ZkEventError::ProofGenerationFailed(e.to_string())),
Expand Down
1 change: 1 addition & 0 deletions crates/zk-prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ e3-data.workspace = true
e3-utils.workspace = true

[dev-dependencies]
paste = "1"
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }

[features]
Expand Down
9 changes: 2 additions & 7 deletions crates/zk-prover/src/circuits/dkg/pk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ use e3_fhe_params::BfvPreset;
use e3_zk_helpers::circuits::dkg::pk::circuit::{PkCircuit, PkCircuitInput};
use e3_zk_helpers::circuits::dkg::pk::computation::Witness;
use e3_zk_helpers::Computation;
use fhe::bfv::PublicKey;
use noirc_abi::InputMap;

impl Provable for PkCircuit {
type Params = BfvPreset;
type Input = PublicKey;
type Input = PkCircuitInput;

fn circuit(&self) -> CircuitName {
CircuitName::PkBfv
Expand All @@ -28,11 +27,7 @@ impl Provable for PkCircuit {
preset: &Self::Params,
input: &Self::Input,
) -> Result<InputMap, ZkError> {
let circuit_input = PkCircuitInput {
public_key: input.clone(),
};

let witness = Witness::compute(preset.clone(), &circuit_input)
let witness = Witness::compute(preset.clone(), input)
.map_err(|e| ZkError::WitnessGenerationFailed(e.to_string()))?;

let mut inputs = InputMap::new();
Expand Down
Loading
Loading