mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 10:32:29 +00:00
feat(big): add MulMod
This commit is contained in:
parent
a597e8f495
commit
8bdbe3c653
3 changed files with 74 additions and 0 deletions
|
|
@ -231,6 +231,16 @@ void Mul(BigBuffer& a, const BigBuffer& b, const BigBuffer& c, BigStack& stack)
|
|||
stack.UnmakeDistinct(a, aa);
|
||||
}
|
||||
|
||||
void MulMod(BigBuffer& a, const BigBuffer& b, const BigBuffer& c, const BigBuffer& d, BigStack& stack) {
|
||||
uint32_t allocCount = 0;
|
||||
auto& scratch = stack.Alloc(&allocCount);
|
||||
|
||||
Mul(scratch, b, c, stack);
|
||||
Div(scratch, a, scratch, d, stack);
|
||||
|
||||
stack.Free(allocCount);
|
||||
}
|
||||
|
||||
void SetOne(BigBuffer& buffer) {
|
||||
buffer.SetCount(1);
|
||||
buffer[0] = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue