mirror of
https://github.com/tlsnotary/tlsn.git
synced 2026-01-09 21:38:00 -05:00
chore: bump mpz to abd02e6 (#825)
This commit is contained in:
26
Cargo.toml
26
Cargo.toml
@@ -69,19 +69,19 @@ tlsn-tls-core = { path = "crates/tls/core" }
|
||||
tlsn-utils = { git = "https://github.com/tlsnotary/tlsn-utils", rev = "6168663" }
|
||||
tlsn-verifier = { path = "crates/verifier" }
|
||||
|
||||
mpz-circuits = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "39f64de" }
|
||||
mpz-memory-core = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "39f64de" }
|
||||
mpz-common = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "39f64de" }
|
||||
mpz-core = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "39f64de" }
|
||||
mpz-vm-core = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "39f64de" }
|
||||
mpz-garble = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "39f64de" }
|
||||
mpz-garble-core = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "39f64de" }
|
||||
mpz-ole = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "39f64de" }
|
||||
mpz-ot = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "39f64de" }
|
||||
mpz-share-conversion = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "39f64de" }
|
||||
mpz-fields = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "39f64de" }
|
||||
mpz-zk = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "39f64de" }
|
||||
mpz-hash = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "39f64de" }
|
||||
mpz-circuits = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "abd02e6" }
|
||||
mpz-memory-core = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "abd02e6" }
|
||||
mpz-common = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "abd02e6" }
|
||||
mpz-core = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "abd02e6" }
|
||||
mpz-vm-core = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "abd02e6" }
|
||||
mpz-garble = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "abd02e6" }
|
||||
mpz-garble-core = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "abd02e6" }
|
||||
mpz-ole = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "abd02e6" }
|
||||
mpz-ot = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "abd02e6" }
|
||||
mpz-share-conversion = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "abd02e6" }
|
||||
mpz-fields = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "abd02e6" }
|
||||
mpz-zk = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "abd02e6" }
|
||||
mpz-hash = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "abd02e6" }
|
||||
|
||||
rangeset = { version = "0.2" }
|
||||
serio = { version = "0.2" }
|
||||
|
||||
@@ -184,6 +184,10 @@ where
|
||||
{
|
||||
type Error = VmError;
|
||||
|
||||
fn is_alloc_raw(&self, slice: Slice) -> bool {
|
||||
self.mpc.try_lock().unwrap().is_alloc_raw(slice)
|
||||
}
|
||||
|
||||
fn alloc_raw(&mut self, size: usize) -> Result<Slice, VmError> {
|
||||
if self.desync.load(Ordering::Relaxed) {
|
||||
return Err(VmError::memory(
|
||||
@@ -195,6 +199,10 @@ where
|
||||
self.mpc.try_lock().unwrap().alloc_raw(size)
|
||||
}
|
||||
|
||||
fn is_assigned_raw(&self, slice: Slice) -> bool {
|
||||
self.mpc.try_lock().unwrap().is_assigned_raw(slice)
|
||||
}
|
||||
|
||||
fn assign_raw(&mut self, slice: Slice, data: BitVec) -> Result<(), VmError> {
|
||||
self.zk
|
||||
.try_lock()
|
||||
@@ -203,6 +211,10 @@ where
|
||||
self.mpc.try_lock().unwrap().assign_raw(slice, data)
|
||||
}
|
||||
|
||||
fn is_committed_raw(&self, slice: Slice) -> bool {
|
||||
self.mpc.try_lock().unwrap().is_committed_raw(slice)
|
||||
}
|
||||
|
||||
fn commit_raw(&mut self, slice: Slice) -> Result<(), VmError> {
|
||||
// Follower's private inputs are not committed in the ZK VM until finalization.
|
||||
let input_minus_follower = slice.to_range().difference(&self.follower_inputs);
|
||||
|
||||
@@ -129,42 +129,34 @@ fn build_pair(config: Config) -> (MpcTlsLeader, MpcTlsFollower) {
|
||||
let (rcot_send_a, rcot_recv_b) = ideal_rcot(Block::random(&mut rng), delta_a.into_inner());
|
||||
let (rcot_send_b, rcot_recv_a) = ideal_rcot(Block::random(&mut rng), delta_b.into_inner());
|
||||
|
||||
let mut rcot_send_a = SharedRCOTSender::new(4, rcot_send_a);
|
||||
let mut rcot_send_b = SharedRCOTSender::new(1, rcot_send_b);
|
||||
let mut rcot_recv_a = SharedRCOTReceiver::new(1, rcot_recv_a);
|
||||
let mut rcot_recv_b = SharedRCOTReceiver::new(4, rcot_recv_b);
|
||||
let rcot_send_a = SharedRCOTSender::new(rcot_send_a);
|
||||
let rcot_send_b = SharedRCOTSender::new(rcot_send_b);
|
||||
let rcot_recv_a = SharedRCOTReceiver::new(rcot_recv_a);
|
||||
let rcot_recv_b = SharedRCOTReceiver::new(rcot_recv_b);
|
||||
|
||||
let mpc_a = Arc::new(Mutex::new(Garbler::new(
|
||||
DerandCOTSender::new(rcot_send_a.next().unwrap()),
|
||||
DerandCOTSender::new(rcot_send_a.clone()),
|
||||
rand::rng().random(),
|
||||
delta_a,
|
||||
)));
|
||||
let mpc_b = Arc::new(Mutex::new(Evaluator::new(DerandCOTReceiver::new(
|
||||
rcot_recv_b.next().unwrap(),
|
||||
rcot_recv_b.clone(),
|
||||
))));
|
||||
|
||||
let leader = MpcTlsLeader::new(
|
||||
config.clone(),
|
||||
ctx_a,
|
||||
mpc_a,
|
||||
(
|
||||
rcot_send_a.next().unwrap(),
|
||||
rcot_send_a.next().unwrap(),
|
||||
rcot_send_a.next().unwrap(),
|
||||
),
|
||||
rcot_recv_a.next().unwrap(),
|
||||
(rcot_send_a.clone(), rcot_send_a.clone(), rcot_send_a),
|
||||
rcot_recv_a,
|
||||
);
|
||||
|
||||
let follower = MpcTlsFollower::new(
|
||||
config,
|
||||
ctx_b,
|
||||
mpc_b,
|
||||
rcot_send_b.next().unwrap(),
|
||||
(
|
||||
rcot_recv_b.next().unwrap(),
|
||||
rcot_recv_b.next().unwrap(),
|
||||
rcot_recv_b.next().unwrap(),
|
||||
),
|
||||
rcot_send_b,
|
||||
(rcot_recv_b.clone(), rcot_recv_b.clone(), rcot_recv_b),
|
||||
);
|
||||
|
||||
(leader, follower)
|
||||
|
||||
@@ -364,16 +364,16 @@ fn build_mpc_tls(config: &ProverConfig, ctx: Context) -> (Arc<Mutex<Deap<Mpc, Zk
|
||||
rcot_recv,
|
||||
);
|
||||
|
||||
let mut rcot_send = mpz_ot::rcot::shared::SharedRCOTSender::new(4, rcot_send);
|
||||
let mut rcot_recv = mpz_ot::rcot::shared::SharedRCOTReceiver::new(2, rcot_recv);
|
||||
let rcot_send = mpz_ot::rcot::shared::SharedRCOTSender::new(rcot_send);
|
||||
let rcot_recv = mpz_ot::rcot::shared::SharedRCOTReceiver::new(rcot_recv);
|
||||
|
||||
let mpc = Mpc::new(
|
||||
mpz_ot::cot::DerandCOTSender::new(rcot_send.next().expect("enough senders are available")),
|
||||
mpz_ot::cot::DerandCOTSender::new(rcot_send.clone()),
|
||||
rng.random(),
|
||||
delta,
|
||||
);
|
||||
|
||||
let zk = Zk::new(rcot_recv.next().expect("enough receivers are available"));
|
||||
let zk = Zk::new(rcot_recv.clone());
|
||||
|
||||
let vm = Arc::new(Mutex::new(Deap::new(tlsn_deap::Role::Leader, mpc, zk)));
|
||||
|
||||
@@ -383,12 +383,8 @@ fn build_mpc_tls(config: &ProverConfig, ctx: Context) -> (Arc<Mutex<Deap<Mpc, Zk
|
||||
config.build_mpc_tls_config(),
|
||||
ctx,
|
||||
vm,
|
||||
(
|
||||
rcot_send.next().expect("enough senders are available"),
|
||||
rcot_send.next().expect("enough senders are available"),
|
||||
rcot_send.next().expect("enough senders are available"),
|
||||
),
|
||||
rcot_recv.next().expect("enough receivers are available"),
|
||||
(rcot_send.clone(), rcot_send.clone(), rcot_send),
|
||||
rcot_recv,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -350,17 +350,12 @@ fn build_mpc_tls(
|
||||
let rcot_recv =
|
||||
mpz_ot::kos::Receiver::new(mpz_ot::kos::ReceiverConfig::default(), base_ot_send);
|
||||
|
||||
let mut rcot_send = mpz_ot::rcot::shared::SharedRCOTSender::new(2, rcot_send);
|
||||
let mut rcot_recv = mpz_ot::rcot::shared::SharedRCOTReceiver::new(4, rcot_recv);
|
||||
let rcot_send = mpz_ot::rcot::shared::SharedRCOTSender::new(rcot_send);
|
||||
let rcot_recv = mpz_ot::rcot::shared::SharedRCOTReceiver::new(rcot_recv);
|
||||
|
||||
let mpc = Mpc::new(mpz_ot::cot::DerandCOTReceiver::new(
|
||||
rcot_recv.next().expect("receivers should be available"),
|
||||
));
|
||||
let mpc = Mpc::new(mpz_ot::cot::DerandCOTReceiver::new(rcot_recv.clone()));
|
||||
|
||||
let zk = Zk::new(
|
||||
delta,
|
||||
rcot_send.next().expect("senders should be available"),
|
||||
);
|
||||
let zk = Zk::new(delta, rcot_send.clone());
|
||||
|
||||
let vm = Arc::new(Mutex::new(Deap::new(tlsn_deap::Role::Follower, mpc, zk)));
|
||||
|
||||
@@ -370,12 +365,8 @@ fn build_mpc_tls(
|
||||
config.build_mpc_tls_config(protocol_config),
|
||||
ctx,
|
||||
vm,
|
||||
rcot_send.next().expect("senders should be available"),
|
||||
(
|
||||
rcot_recv.next().expect("receivers should be available"),
|
||||
rcot_recv.next().expect("receivers should be available"),
|
||||
rcot_recv.next().expect("receivers should be available"),
|
||||
),
|
||||
rcot_send,
|
||||
(rcot_recv.clone(), rcot_recv.clone(), rcot_recv),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user