Small patches

This commit is contained in:
Jordi Baylina
2018-12-22 23:54:25 +01:00
parent 345f040b41
commit 0639963bea
18 changed files with 379 additions and 272968 deletions

View File

@@ -44,6 +44,17 @@ template IsEqual() {
isz.out ==> out;
}
template ForceEqualIfEnabled() {
signal input enabled;
signal input in[2];
component isz = IsZero();
in[1] - in[0] ==> isz.in;
(1 - isz.out)*enabled === 0;
}
// N is the number of bits the input have.
// The MSF is the sign bit.