maskBits
Masks the lower k bits of a BigInt (computes abs(n) & ((1<<k)-1)).
This is a helper function that extracts the lower k bits of the absolute value of n, effectively computing n mod 2^k for positive n.
Parameters
n | The value to mask |
k | The number of bits to keep |
Returns
The lower k bits of abs(n)