Skip to content

Commit

Permalink
Fix Issue encryptogroup#124
Browse files Browse the repository at this point in the history
Fixes an issue which causes the evaluation of constant gates of bool shares to skip the last 64 bits if nvals is larger than 64 and nvals is a modulo of 64.
Martin Kromm committed Mar 11, 2019
1 parent 902e949 commit 51c53c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/abycore/sharing/boolsharing.cpp
Original file line number Diff line number Diff line change
@@ -714,7 +714,9 @@ inline void BoolSharing::EvaluateConstantGate(uint32_t gateid) {
gate->gs.val[i] = ~(0L);
}
}
gate->gs.val[ceil_divide(gate->nvals, GATE_T_BITS)-1] &= ((1L<<(gate->nvals%64)) -1L);
if(gate->nvals % GATE_T_BITS != 0) {
gate->gs.val[ceil_divide(gate->nvals, GATE_T_BITS)-1] &= ((1L<<(gate->nvals%64)) -1L);
}
#ifdef DEBUGBOOL
std::cout << "Constant gate value: "<< value << std::endl;
#endif

0 comments on commit 51c53c0

Please sign in to comment.