From 0eab0be771ac395d5d4fb5c2a76eeb2fcf4bed08 Mon Sep 17 00:00:00 2001 From: th4s Date: Fri, 13 Dec 2024 18:51:56 +0100 Subject: [PATCH] fix: deadlock for garble-vm (#197) * fix(garble): do not hang when output is used as input * fix(garble): fix hanging in preprocessing * fix: adapt `is_committed` to consider complete outputs --- crates/mpz-garble-core/src/view.rs | 2 +- crates/mpz-garble/src/protocol/semihonest/evaluator.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/mpz-garble-core/src/view.rs b/crates/mpz-garble-core/src/view.rs index e1683951..6893e5ca 100644 --- a/crates/mpz-garble-core/src/view.rs +++ b/crates/mpz-garble-core/src/view.rs @@ -216,7 +216,7 @@ impl View { } pub(crate) fn is_committed(&self, range: Range) -> bool { - range.is_subset(&self.input.complete) + range.is_subset(&self.input.complete) || range.is_subset(&self.output.complete) } pub(crate) fn commit(&mut self, range: Range) -> Result<()> { diff --git a/crates/mpz-garble/src/protocol/semihonest/evaluator.rs b/crates/mpz-garble/src/protocol/semihonest/evaluator.rs index 92da484a..dcea1246 100644 --- a/crates/mpz-garble/src/protocol/semihonest/evaluator.rs +++ b/crates/mpz-garble/src/protocol/semihonest/evaluator.rs @@ -57,6 +57,7 @@ impl Evaluator { idx_outputs |= output.to_range(); true } else { + idx_outputs |= output.to_range(); false } })