diff --git a/readme.md b/readme.md index 4f20b56..a0c4397 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,7 @@ # mcl -A generic and fast pairing-based cryptography library. +A portable and fast pairing-based cryptography library. # Abstract diff --git a/src/fp.cpp b/src/fp.cpp index d9f3060..c720475 100644 --- a/src/fp.cpp +++ b/src/fp.cpp @@ -201,6 +201,7 @@ void getRandVal(Unit *out, RandGen& rg, const Unit *in, size_t bitSize) if (rg.isZero()) rg = RandGen::get(); const size_t n = (bitSize + UnitBitSize - 1) / UnitBitSize; const size_t rem = bitSize & (UnitBitSize - 1); + assert(n > 0); for (;;) { rg.read(out, n * sizeof(Unit)); if (rem > 0) out[n - 1] &= (Unit(1) << rem) - 1;