check maxBitSize

dev
MITSUNARI Shigeo 9 years ago
parent 3e8dbe1b50
commit 9e10683b88
  1. 3
      src/fp.cpp

@ -378,6 +378,9 @@ static void initForMont(Op& op, const Unit *p, Mode mode)
void Op::init(const std::string& mstr, int base, size_t maxBitSize, Mode mode)
{
if (maxBitSize > MCL_MAX_OP_BIT_SIZE) {
throw cybozu::Exception("Op:init:too large maxBitSize") << maxBitSize << MCL_MAX_OP_BIT_SIZE;
}
cybozu::disable_warning_unused_variable(mode);
bool isMinus = fp::strToMpzArray(&bitSize, p, maxBitSize, mp, mstr, base);
if (isMinus) throw cybozu::Exception("Op:init:mstr is minus") << mstr;

Loading…
Cancel
Save