secretflow/yacl

The enforcement in `bristol_fashion` is not precise

Closed this issue · 3 comments

In yacl/io/circuit/bristol_fashion.cc, ReadAllGates()
YACL_ENFORCE(splits.size() >= circ_->gates[i].niw + circ_->gates[i].now + 2);
The >= should be > .

And YACL_ENFORCE(circ_->gates[i].now == 1) is strange, for MAND gate could have many output wires.

In circuit_executor_test.cc, ReverseBytes does not reverse bits, but reverses bytes. The annotation thus bit 0 becomes bit 127 etc is not precise.

The >= should be >

Yes, this indeed should be >

And YACL_ENFORCE(circ_->gates[i].now == 1) is strange, for MAND gate could have many output wires.

Yes, this is a known issue. And we're still working on proper ways to support the MAND gate. Also, since are not not using MAND gate in all pre-built-in circuits, it's okay for now.

In circuit_executor_test.cc, ReverseBytes does not reversie bits, but reverses bytes. The annotation thus bit 0 becomes bit 127 etc is not precise.

see: https://nigelsmart.github.io/MPC-Circuits/, that comment is a quote from this webpage.

BTW. since there are indeed unfinished features, you could leave this issue open till it's fully resolved