feat(big) add SBigIsEven

This commit is contained in:
Adam Heinermann 2024-11-15 08:27:03 -08:00 committed by superp00t
parent 328bbf61d8
commit 6759cb4d7c
5 changed files with 34 additions and 0 deletions

View file

@ -211,6 +211,10 @@ void InsertLowPart(uint64_t& value, uint32_t low) {
value = (value << 32) | low;
}
int32_t IsEven(const BigBuffer &num) {
return num.Count() == 0 || (num[0] & 1) == 0;
}
uint64_t MakeLarge(uint32_t low, uint32_t high) {
return low + (static_cast<uint64_t>(high) << 32);
}

View file

@ -33,6 +33,8 @@ uint32_t HighBitPos(const BigBuffer& buffer);
void InsertLowPart(uint64_t& value, uint32_t low);
int32_t IsEven(const BigBuffer &num);
uint64_t MakeLarge(uint32_t low, uint32_t high);
void Mul(BigBuffer& a, const BigBuffer& b, uint64_t c);