Skip to content

Commit

Permalink
LowGear with higher statistical security.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkskeller committed Apr 16, 2021
1 parent 8c9a743 commit 6c89808
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Math/fixint.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
template<int L>
class fixint : public SignedZ2<64 * (L + 1)>
{
static const int OVERFLOW = 60;

public:
typedef SignedZ2<64 * (L + 1)> super;

Expand All @@ -22,7 +24,7 @@ class fixint : public SignedZ2<64 * (L + 1)>
fixint(const T& other) :
super(other)
{
char check = this->a[this->N_WORDS - 1] >> 56;
auto check = mp_limb_signed_t(this->a[this->N_WORDS - 1]) >> OVERFLOW;
assert(check == 0 or check == -1);
}

Expand Down Expand Up @@ -68,7 +70,7 @@ class fixint : public SignedZ2<64 * (L + 1)>
void allocate_slots(const T& limit)
{
int n_bits = this->size_in_bits();
if (numBits(limit) - 56 > n_bits)
if (numBits(limit) - OVERFLOW > n_bits)
{
cerr << "cannot hold " << numBits(limit) << " bits, " << n_bits
<< " available" << endl;
Expand Down

0 comments on commit 6c89808

Please sign in to comment.