Module crypto_bigint::prelude
source · Expand description
Import prelude for this crate: includes important traits.
Enums
- Possible errors of the methods in
RandomBits
trait.
Traits
- Compute
self + rhs mod p
. - ArrayDecoding
hybrid-array
Support for decoding aArray
as a big integer. - ArrayEncoding
hybrid-array
Support for encoding a big integer as aArray
. - Bit counting and bit operations.
- Integers whose representation takes a bounded amount of space.
- Checked addition.
- Checked division.
- Checked multiplication.
- Checked subtraction.
- Concatenate two numbers into a “wide” double-width value, using the
hi
value as the most significant portion of the resulting value. - Concatenate two numbers into a “wide” combined-width value, using the
hi
value as the most significant value. - Trait for associating a constant representing zero.
- Trait for types which are conditionally selectable in constant time, similar to (and blanket impl’d for)
subtle
’sConditionallySelectable
trait, but without theCopy
bound which allows it to be impl’d for heap allocated types such asBoxedUint
. - Trait for associating constant values with a type.
- Support for optimized division by a single limb.
- Encoding support.
- Fixed-width integers.
- Compute greatest common divisor of two integers.
- Integer trait: represents common functionality of integer types provided by this crate.
- Compute
1 / self mod p
. - Constant-time inversion.
- Trait impl’d by precomputed modular inverters obtained via the
PrecomputeInverter
trait. - A representation of an integer optimized for the performance of modular operations.
- Compute
self * rhs mod p
. - Performs modular multi-exponentiation using Montgomery’s ladder.
- Performs modular multi-exponentiation using Montgomery’s ladder.
exponent_bits
represents the number of bits to take into account for the exponent. - Compute
-self mod p
. - Constant-time exponentiation.
- Constant-time exponentiation with exponent of a bounded bit size.
- Obtain a precomputed inverter for efficiently computing modular inversions for a given modulus.
- Random number generation support.
- Random bits generation support.
- Modular random number generation support.
- Support for optimized division by a single limb.
- Left shifts, variable time in
shift
. - Right shifts, variable time in
shift
. - Split a number in half, returning the least significant half followed by the most significant.
- Split a number into parts, returning the least significant part followed by the most significant.
- Support for optimized squaring
- Support for optimized squaring in-place
- Support for calucaling square roots.
- Compute
self - rhs mod p
. - Widening multiply: returns a value with a number of limbs equal to the sum of the inputs.
- Performs addition that wraps around on overflow.
- Performs multiplication that wraps around on overflow.
- Performs a negation that does not panic.
- Performs a left shift that does not panic.
- Performs a right shift that does not panic.
- Performs subtraction that wraps around on overflow.
- Zero values.