More efficient comparison calls (#14)

This commit is contained in:
Edward Chen
2021-08-20 07:25:52 -07:00
committed by GitHub
parent 0528353296
commit df8cdeece9

View File

@@ -272,12 +272,11 @@ impl ToABY {
match op {
BvBinPred::Uge => {
let eq = self.embed_eq(t.clone(), &t.cs[0], &t.cs[1]);
self.cache.insert(
t.clone(),
EmbeddedTerm::Bool(format!(
"((BooleanCircuit *)circ)->PutORGate(circ->PutGTGate({}, {}), {})",
a, b, eq
"((BooleanCircuit *)circ)->PutINVGate(circ->PutGTGate({}, {}))",
b, a
)),
);
}
@@ -288,12 +287,11 @@ impl ToABY {
);
}
BvBinPred::Ule => {
let eq = self.embed_eq(t.clone(), &t.cs[0], &t.cs[1]);
self.cache.insert(
t.clone(),
EmbeddedTerm::Bool(format!(
"((BooleanCircuit *)circ)->PutORGate(circ->PutGTGate({}, {}), {})",
b, a, eq
"((BooleanCircuit *)circ)->PutINVGate(circ->PutGTGate({}, {}))",
a, b
)),
);
}