Expand description
Unsigned multi-precision integer arithmetic.
Limbs ordered least-significant-limb to most-significant-limb. The bits limbs use the native endianness.
Enums§
Constants§
Functions§
- LIMB
S_ π βare_ even - LIMB
S_ π βare_ zero - LIMB
S_ π βequal_ limb - LIMB
S_ π βless_ than - LIMB
S_ π βless_ than_ limb - LIMB
S_ π βreduce_ once - LIMB_
shr π β - Processes
limbs
as a sequence of 5-bit windows, folding the windows from most significant to least significant and returning the accumulated result. The first window will be mapped byinit
to produce the initial value for the accumulator. Thenf
will be called to fold the accumulator and the next window until all windows are processed. When the inputβs bit length isnβt divisible by 5, the window passed toinit
will be partial; all windows passed tofold
will be full. - limbs_
add_ πassign_ mod - limbs_
double_ πmod - Returns the number of bits in
a
. - limbs_
negative_ πodd - Equivalent to
if (r >= m) { r -= m; }
- Parses
input
intoresult
, paddingresult
with zeros to its length. This attempts to be constant-time with respect to the value but not with respect to the length; it is assumed that the length is public knowledge. - Parses
input
intoresult
, verifies that the value is less thanmax_exclusive
, and padsresult
with zeros to its length. Ifallow_zero
is notAllowZero::Yes
, zero values are rejected. - Returns an iterator of the big-endian encoding of
limbs
.