Module backend
Expand description
Abstract big integer backend. This module makes no guarantees of applicability, all methods are considered internal, except for conversion functions:
Integer::to_bytes_lsfInteger::to_bytes_msfInteger::from_bytes_msfInteger::to_str_radixInteger::from_str_radixnum_bigint::Integer::to_num_bigintnum_bigint::Integer::from_num_bigintrug::Integer::to_rugrug::Integer::from_rug
Likewise, the serde serialization format is also well-defined and stable, even compatible with older versions of this library.
To select a backend, use a feature flag:
When both features are enabled at once, num-bigint is used
Modules§
Structs§
- Integer
- Big integer type used in this crate
Enums§
- IsPrime
- Whether a number is prime. See
Integer::is_probably_primemethod - Sign
- Sign of a number, to distinguish positives and zero from negatives
Functions§
- sieve_
generate_ safe_ primes - Generate a random safe prime with a given sieve parameter.