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§
source§impl AddAssign<&BigInt> for BigInt
impl AddAssign<&BigInt> for BigInt
source§fn add_assign(&mut self, rhs: &BigInt)
fn add_assign(&mut self, rhs: &BigInt)
Performs the
+=
operation. Read moresource§impl AddAssign<BigInt> for BigInt
impl AddAssign<BigInt> for BigInt
source§fn add_assign(&mut self, rhs: BigInt)
fn add_assign(&mut self, rhs: BigInt)
Performs the
+=
operation. Read moresource§impl AddAssign<u64> for BigInt
impl AddAssign<u64> for BigInt
source§fn add_assign(&mut self, rhs: u64)
fn add_assign(&mut self, rhs: u64)
Performs the
+=
operation. Read moresource§impl BitAndAssign<&BigInt> for BigInt
impl BitAndAssign<&BigInt> for BigInt
source§fn bitand_assign(&mut self, rhs: &BigInt)
fn bitand_assign(&mut self, rhs: &BigInt)
Performs the
&=
operation. Read moresource§impl BitAndAssign<BigInt> for BigInt
impl BitAndAssign<BigInt> for BigInt
source§fn bitand_assign(&mut self, rhs: BigInt)
fn bitand_assign(&mut self, rhs: BigInt)
Performs the
&=
operation. Read moresource§impl BitManipulation for BigInt
impl BitManipulation for BigInt
source§impl BitOrAssign<&BigInt> for BigInt
impl BitOrAssign<&BigInt> for BigInt
source§fn bitor_assign(&mut self, rhs: &BigInt)
fn bitor_assign(&mut self, rhs: &BigInt)
Performs the
|=
operation. Read moresource§impl BitOrAssign<BigInt> for BigInt
impl BitOrAssign<BigInt> for BigInt
source§fn bitor_assign(&mut self, rhs: BigInt)
fn bitor_assign(&mut self, rhs: BigInt)
Performs the
|=
operation. Read moresource§impl BitXorAssign<&BigInt> for BigInt
impl BitXorAssign<&BigInt> for BigInt
source§fn bitxor_assign(&mut self, rhs: &BigInt)
fn bitxor_assign(&mut self, rhs: &BigInt)
Performs the
^=
operation. Read moresource§impl BitXorAssign<BigInt> for BigInt
impl BitXorAssign<BigInt> for BigInt
source§fn bitxor_assign(&mut self, rhs: BigInt)
fn bitxor_assign(&mut self, rhs: BigInt)
Performs the
^=
operation. Read moresource§impl Converter for BigInt
impl Converter for BigInt
source§fn from_bytes(bytes: &[u8]) -> BigInt
fn from_bytes(bytes: &[u8]) -> BigInt
Constructs BigInt from its byte representation Read more
source§fn from_hex(value: &str) -> Result<BigInt, ParseBigIntError>
fn from_hex(value: &str) -> Result<BigInt, ParseBigIntError>
Parses given hex string. Read more
source§fn to_str_radix(&self, radix: u8) -> String
fn to_str_radix(&self, radix: u8) -> String
Converts BigInt to radix representation. Read more
source§fn from_str_radix(str: &str, radix: u8) -> Result<BigInt, ParseBigIntError>
fn from_str_radix(str: &str, radix: u8) -> Result<BigInt, ParseBigIntError>
Parses given radix string. Read more
source§fn to_bytes_array<const N: usize>(&self) -> Option<[u8; N]>
fn to_bytes_array<const N: usize>(&self) -> Option<[u8; N]>
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
source§impl<'de> Deserialize<'de> for BigInt
impl<'de> Deserialize<'de> for BigInt
source§fn deserialize<D>(
deserializer: D
) -> Result<BigInt, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<BigInt, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl DivAssign<&BigInt> for BigInt
impl DivAssign<&BigInt> for BigInt
source§fn div_assign(&mut self, rhs: &BigInt)
fn div_assign(&mut self, rhs: &BigInt)
Performs the
/=
operation. Read moresource§impl DivAssign<BigInt> for BigInt
impl DivAssign<BigInt> for BigInt
source§fn div_assign(&mut self, rhs: BigInt)
fn div_assign(&mut self, rhs: BigInt)
Performs the
/=
operation. Read moresource§impl DivAssign<u64> for BigInt
impl DivAssign<u64> for BigInt
source§fn div_assign(&mut self, rhs: u64)
fn div_assign(&mut self, rhs: u64)
Performs the
/=
operation. Read moresource§impl<'b> From<&'b BigInt> for Randomness
impl<'b> From<&'b BigInt> for Randomness
source§fn from(x: &'b BigInt) -> Randomness
fn from(x: &'b BigInt) -> Randomness
Converts to this type from the input type.
source§impl<'b> From<&'b BigInt> for RawCiphertext<'b>
impl<'b> From<&'b BigInt> for RawCiphertext<'b>
source§impl<'b> From<&'b BigInt> for RawPlaintext<'b>
impl<'b> From<&'b BigInt> for RawPlaintext<'b>
source§impl<'n> From<&'n BigInt> for EncryptionKey
impl<'n> From<&'n BigInt> for EncryptionKey
source§impl From<BigInt> for Randomness
impl From<BigInt> for Randomness
source§fn from(x: BigInt) -> Randomness
fn from(x: BigInt) -> Randomness
Converts to this type from the input type.
source§impl<'b> From<BigInt> for RawCiphertext<'b>
impl<'b> From<BigInt> for RawCiphertext<'b>
source§impl<'b> From<BigInt> for RawPlaintext<'b>
impl<'b> From<BigInt> for RawPlaintext<'b>
source§impl<'b> From<RawCiphertext<'b>> for BigInt
impl<'b> From<RawCiphertext<'b>> for BigInt
source§fn from(x: RawCiphertext<'b>) -> Self
fn from(x: RawCiphertext<'b>) -> Self
Converts to this type from the input type.
source§impl<'b> From<RawPlaintext<'b>> for BigInt
impl<'b> From<RawPlaintext<'b>> for BigInt
source§fn from(x: RawPlaintext<'b>) -> Self
fn from(x: RawPlaintext<'b>) -> Self
Converts to this type from the input type.
source§impl Integer for BigInt
impl Integer for BigInt
source§fn is_multiple_of(&self, other: &BigInt) -> bool
fn is_multiple_of(&self, other: &BigInt) -> bool
source§fn div_rem(&self, other: &BigInt) -> (BigInt, BigInt)
fn div_rem(&self, other: &BigInt) -> (BigInt, BigInt)
Simultaneous truncated integer division and modulus.
Returns
(quotient, remainder)
. Read moresource§fn gcd_lcm(&self, other: &Self) -> (Self, Self)
fn gcd_lcm(&self, other: &Self) -> (Self, Self)
Greatest Common Divisor (GCD) and
Lowest Common Multiple (LCM) together. Read more
source§fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where
Self: Clone,
fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where
Self: Clone,
Greatest common divisor and Bézout coefficients. Read more
source§fn div_mod_floor(&self, other: &Self) -> (Self, Self)
fn div_mod_floor(&self, other: &Self) -> (Self, Self)
Simultaneous floored integer division and modulus.
Returns
(quotient, remainder)
. Read moresource§impl Modulo for BigInt
impl Modulo for BigInt
source§impl MulAssign<&BigInt> for BigInt
impl MulAssign<&BigInt> for BigInt
source§fn mul_assign(&mut self, rhs: &BigInt)
fn mul_assign(&mut self, rhs: &BigInt)
Performs the
*=
operation. Read moresource§impl MulAssign<BigInt> for BigInt
impl MulAssign<BigInt> for BigInt
source§fn mul_assign(&mut self, rhs: BigInt)
fn mul_assign(&mut self, rhs: BigInt)
Performs the
*=
operation. Read moresource§impl MulAssign<u64> for BigInt
impl MulAssign<u64> for BigInt
source§fn mul_assign(&mut self, rhs: u64)
fn mul_assign(&mut self, rhs: u64)
Performs the
*=
operation. Read moresource§impl Num for BigInt
impl Num for BigInt
type FromStrRadixErr = ParseBigIntError
source§fn from_str_radix(str: &str, radix: u32) -> Result<BigInt, ParseBigIntError>
fn from_str_radix(str: &str, radix: u32) -> Result<BigInt, ParseBigIntError>
Convert from a string and radix (typically
2..=36
). Read moresource§impl NumberTests for BigInt
impl NumberTests for BigInt
source§impl Ord for BigInt
impl Ord for BigInt
source§impl PartialEq<BigInt> for BigInt
impl PartialEq<BigInt> for BigInt
source§impl PartialOrd<BigInt> for BigInt
impl PartialOrd<BigInt> for BigInt
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<'ek, 'r> PrecomputeRandomness<&'ek EncryptionKey, &'r BigInt, PrecomputedRandomness> for Paillier
impl<'ek, 'r> PrecomputeRandomness<&'ek EncryptionKey, &'r BigInt, PrecomputedRandomness> for Paillier
fn precompute(ek: &'ek EncryptionKey, r: &'r BigInt) -> PrecomputedRandomness
source§impl PrimeSampable for BigInt
impl PrimeSampable for BigInt
fn sample_prime(bitsize: usize) -> Self
fn sample_safe_prime(bitsize: usize) -> Self
source§impl Primes for BigInt
impl Primes for BigInt
source§fn next_prime(&self) -> BigInt
fn next_prime(&self) -> BigInt
Finds next prime number using probabilistic algorithms
source§impl RemAssign<&BigInt> for BigInt
impl RemAssign<&BigInt> for BigInt
source§fn rem_assign(&mut self, rhs: &BigInt)
fn rem_assign(&mut self, rhs: &BigInt)
Performs the
%=
operation. Read moresource§impl RemAssign<BigInt> for BigInt
impl RemAssign<BigInt> for BigInt
source§fn rem_assign(&mut self, rhs: BigInt)
fn rem_assign(&mut self, rhs: BigInt)
Performs the
%=
operation. Read moresource§impl RemAssign<u64> for BigInt
impl RemAssign<u64> for BigInt
source§fn rem_assign(&mut self, rhs: u64)
fn rem_assign(&mut self, rhs: u64)
Performs the
%=
operation. Read moresource§impl Roots for BigInt
impl Roots for BigInt
source§impl Samplable for BigInt
impl Samplable for BigInt
source§fn sample_below(upper: &BigInt) -> BigInt
fn sample_below(upper: &BigInt) -> BigInt
Generates random number within
[0; upper)
range Read moresource§fn sample_range(lower: &BigInt, upper: &BigInt) -> BigInt
fn sample_range(lower: &BigInt, upper: &BigInt) -> BigInt
Generates random number within
[lower; upper)
range Read moresource§fn strict_sample_range(lower: &BigInt, upper: &BigInt) -> BigInt
fn strict_sample_range(lower: &BigInt, upper: &BigInt) -> BigInt
Generates random number within
(lower; upper)
range Read moresource§fn strict_sample(bit_size: usize) -> BigInt
fn strict_sample(bit_size: usize) -> BigInt
Generates number within
[2^(bit_size-1); 2^bit_size)
rangesource§impl Serialize for BigInt
impl Serialize for BigInt
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl ShlAssign<usize> for BigInt
impl ShlAssign<usize> for BigInt
source§fn shl_assign(&mut self, rhs: usize)
fn shl_assign(&mut self, rhs: usize)
Performs the
<<=
operation. Read moresource§impl ShrAssign<usize> for BigInt
impl ShrAssign<usize> for BigInt
source§fn shr_assign(&mut self, rhs: usize)
fn shr_assign(&mut self, rhs: usize)
Performs the
>>=
operation. Read moresource§impl SubAssign<&BigInt> for BigInt
impl SubAssign<&BigInt> for BigInt
source§fn sub_assign(&mut self, rhs: &BigInt)
fn sub_assign(&mut self, rhs: &BigInt)
Performs the
-=
operation. Read moresource§impl SubAssign<BigInt> for BigInt
impl SubAssign<BigInt> for BigInt
source§fn sub_assign(&mut self, rhs: BigInt)
fn sub_assign(&mut self, rhs: BigInt)
Performs the
-=
operation. Read moresource§impl SubAssign<u64> for BigInt
impl SubAssign<u64> for BigInt
source§fn sub_assign(&mut self, rhs: u64)
fn sub_assign(&mut self, rhs: u64)
Performs the
-=
operation. Read moresource§impl ZeroizeBN for BigInt
impl ZeroizeBN for BigInt
source§fn zeroize_bn(&mut self)
fn zeroize_bn(&mut self)
👎Deprecated since 0.6.0: BigInt now implements zeroize::Zeroize trait, you should use it instead