Struct kzen_paillier::BigInt

source ·
pub struct BigInt { /* private fields */ }
Expand description

Big integer

Wraps underlying BigInt implementation (either GMP bindings or num-bigint), exposes only very limited API that allows easily switching between implementations.

Set of traits implemented on BigInt remains the same regardless of underlying implementation.

Trait Implementations§

The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
Performs the += operation. Read more
Performs the += operation. Read more
Performs the += operation. Read more
The resulting type after applying the & operator.
Performs the & operation. Read more
The resulting type after applying the & operator.
Performs the & operation. Read more
The resulting type after applying the & operator.
Performs the & operation. Read more
The resulting type after applying the & operator.
Performs the & operation. Read more
Performs the &= operation. Read more
Performs the &= operation. Read more
Sets/unsets bit in the number Read more
Tests if bit is set Read more
Length of the number in bits Read more
Performs the |= operation. Read more
Performs the |= operation. Read more
The resulting type after applying the ^ operator.
Performs the ^ operation. Read more
The resulting type after applying the ^ operator.
Performs the ^ operation. Read more
The resulting type after applying the ^ operator.
Performs the ^ operation. Read more
The resulting type after applying the ^ operator.
Performs the ^ operation. Read more
Performs the ^= operation. Read more
Performs the ^= operation. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns bytes representation of the number. Read more
Constructs BigInt from its byte representation Read more
Converts BigInt to hex representation. Read more
Parses given hex string. Read more
Converts BigInt to radix representation. Read more
Parses given radix string. Read more
Returns bytes representation of the number in an array with length chosen by the user if the array is larger than the bytes it pads it with zeros in the most significant bytes If the array is too small for the integer it returns None. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Formats the value using the given formatter. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
For given a, b calculates gcd(a,b), p, q such as gcd(a,b) = a*p + b*q Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Floored integer division. Read more
Floored integer modulo, satisfying: Read more
Greatest Common Divisor (GCD). Read more
Lowest Common Multiple (LCM). Read more
Deprecated, use is_multiple_of instead.
Returns true if self is a multiple of other. Read more
Returns true if the number is even. Read more
Returns true if the number is odd. Read more
Simultaneous truncated integer division and modulus. Returns (quotient, remainder). Read more
Ceiled integer division. Read more
Greatest Common Divisor (GCD) and Lowest Common Multiple (LCM) together. Read more
Greatest common divisor and Bézout coefficients. Read more
Simultaneous floored integer division and modulus. Returns (quotient, remainder). Read more
Rounds up to nearest multiple of argument. Read more
Rounds down to nearest multiple of argument. Read more
Calculates base^(exponent) (mod m) Read more
Calculates a * b (mod m)
Calculates a - b (mod m)
Calculates a + b (mod m)
Calculates a^-1 (mod m). Returns None if a and m are not coprimes.
Calculates a mod m
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
The resulting type after applying the - operator.
Performs the unary - operation. Read more
The resulting type after applying the - operator.
Performs the unary - operation. Read more
Convert from a string and radix (typically 2..=36). Read more
Returns true if n is zero Read more
Returns true if n is negative Read more
Returns the multiplicative identity element of Self, 1. Read more
Returns true if self is equal to the multiplicative identity. Read more
Sets self to the multiplicative identity element of Self, 1.
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Finds next prime number using probabilistic algorithms
Probabilistically determine whether number is prime Read more
The resulting type after applying the % operator.
Performs the % operation. Read more
The resulting type after applying the % operator.
Performs the % operation. Read more
The resulting type after applying the % operator.
Performs the % operation. Read more
The resulting type after applying the % operator.
Performs the % operation. Read more
The resulting type after applying the % operator.
Performs the % operation. Read more
The resulting type after applying the % operator.
Performs the % operation. Read more
Performs the %= operation. Read more
Performs the %= operation. Read more
Performs the %= operation. Read more
Returns the truncated principal nth root of an integer – if x >= 0 { ⌊ⁿ√x⌋ } else { ⌈ⁿ√x⌉ } Read more
Returns the truncated principal square root of an integer – ⌊√x⌋ Read more
Returns the truncated principal cube root of an integer – if x >= 0 { ⌊∛x⌋ } else { ⌈∛x⌉ } Read more
Generates random number within [0; upper) range Read more
Generates random number within [lower; upper) range Read more
Generates random number within (lower; upper) range Read more
Generates number within [0; 2^bit_size) range
Generates number within [2^(bit_size-1); 2^bit_size) range
Serialize this value into the given Serde serializer. Read more
The resulting type after applying the << operator.
Performs the << operation. Read more
The resulting type after applying the << operator.
Performs the << operation. Read more
Performs the <<= operation. Read more
The resulting type after applying the >> operator.
Performs the >> operation. Read more
The resulting type after applying the >> operator.
Performs the >> operation. Read more
Performs the >>= operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
Performs the -= operation. Read more
Performs the -= operation. Read more
Performs the -= operation. Read more
Returns the additive identity element of Self, 0. Read more
Returns true if self is equal to the additive identity.
Sets self to the additive identity element of Self, 0.
Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
👎Deprecated since 0.6.0: BigInt now implements zeroize::Zeroize trait, you should use it instead

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.