Module prelude

Source
Expand description

Import prelude for this crate: includes important traits.

Enums§

DecodeError
Possible errors in variable-time integer decoding methods.
RandomBitsErrorrand_core
Possible errors of the methods in RandomBits trait.

Traits§

AddMod
Compute self + rhs mod p.
ArrayDecodinghybrid-array
Support for decoding a Array as a big integer.
ArrayEncodinghybrid-array
Support for encoding a big integer as a Array.
BitOps
Bit counting and bit operations.
Bounded
Integers whose representation takes a bounded amount of space.
CheckedAdd
Checked addition.
CheckedDiv
Checked division.
CheckedMul
Checked multiplication.
CheckedSub
Checked subtraction.
Concat
Concatenate two numbers into a “wide” double-width value, using the hi value as the most significant portion of the resulting value.
ConcatMixed
Concatenate two numbers into a “wide” combined-width value, using the hi value as the most significant value.
ConstZero
Defines an associated constant representing the additive identity element for Self.
ConstantTimeSelect
Trait for types which are conditionally selectable in constant time.
Constants
Trait for associating constant values with a type.
DivRemLimb
Support for optimized division by a single limb.
Encoding
Encoding support.
FixedInteger
Fixed-width integers.
Gcd
Compute the greatest common divisor of two integers.
Integer
Integer trait: represents common functionality of integer types provided by this crate.
InvMod
Compute 1 / self mod p.
Invert
Constant-time inversion.
Inverter
Trait impl’d by precomputed modular inverters obtained via the PrecomputeInverter trait.
Monty
A representation of an integer optimized for the performance of modular operations.
MulMod
Compute self * rhs mod p.
MultiExponentiate
Performs modular multi-exponentiation using Montgomery’s ladder.
MultiExponentiateBoundedExp
Performs modular multi-exponentiation using Montgomery’s ladder. exponent_bits represents the number of bits to take into account for the exponent.
NegMod
Compute -self mod p.
Pow
Constant-time exponentiation.
PowBoundedExp
Constant-time exponentiation with exponent of a bounded bit size.
PrecomputeInverter
Obtain a precomputed inverter for efficiently computing modular inversions for a given modulus.
Randomrand_core
Random number generation support.
RandomBitsrand_core
Random bits generation support.
RandomModrand_core
Modular random number generation support.
RemLimb
Support for optimized division by a single limb.
RemMixed
Support for calculating the remainder of two differently sized integers.
ShlVartime
Left shifts, variable time in shift.
ShrVartime
Right shifts, variable time in shift.
Split
Split a number in half, returning the least significant half followed by the most significant.
SplitMixed
Split a number into parts, returning the least significant part followed by the most significant.
Square
Support for optimized squaring
SquareAssign
Support for optimized squaring in-place
SquareRoot
Support for calucaling square roots.
SubMod
Compute self - rhs mod p.
WideningMul
Widening multiply: returns a value with a number of limbs equal to the sum of the inputs.
WrappingAdd
Performs addition that wraps around on overflow.
WrappingMul
Performs multiplication that wraps around on overflow.
WrappingNeg
Performs a negation that does not panic.
WrappingShl
Performs a left shift that does not panic.
WrappingShr
Performs a right shift that does not panic.
WrappingSub
Performs subtraction that wraps around on overflow.
Zero
Zero values.