pub struct GmpClassGroup { /* private fields */ }Implementations§
Source§impl GmpClassGroup
impl GmpClassGroup
pub fn into_raw(self) -> (Mpz, Mpz)
Sourcepub fn with_context<T, U>(cb: T) -> U
pub fn with_context<T, U>(cb: T) -> U
Call cb with a mutable reference to the context of type Ctx.
The reference cannot escape the closure and cannot be sent across threads.
§Panics
Panics if called recursively. This library guarantees that it will
never call this function from any function that takes a parameter of
type &mut Ctx.
Trait Implementations§
Source§impl ClassGroup for GmpClassGroup
impl ClassGroup for GmpClassGroup
Source§fn discriminant(&self) -> &Self::BigNum
fn discriminant(&self) -> &Self::BigNum
Returns the discriminant of self.
Source§fn repeated_square(&mut self, iterations: u64)
fn repeated_square(&mut self, iterations: u64)
type BigNum = Mpz
Source§fn serialize(&self, buf: &mut [u8]) -> Result<(), usize>
fn serialize(&self, buf: &mut [u8]) -> Result<(), usize>
Serializes
self to a byte array. Returns Err(s) if there
is not enough space in the buffer. Read moreSource§fn from_bytes(bytearray: &[u8], discriminant: Self::BigNum) -> Self
fn from_bytes(bytearray: &[u8], discriminant: Self::BigNum) -> Self
Unmarshals a
Self from a byte array and discriminant. Read moreSource§fn from_ab_discriminant(
a: Self::BigNum,
b: Self::BigNum,
discriminant: Self::BigNum,
) -> Self
fn from_ab_discriminant( a: Self::BigNum, b: Self::BigNum, discriminant: Self::BigNum, ) -> Self
Produces a
Self from a, b, and a discriminant.Source§fn size_in_bits(num: &Self::BigNum) -> usize
fn size_in_bits(num: &Self::BigNum) -> usize
The length of
num in bitsSource§fn deserialize(buf: &[u8], discriminant: Self::BigNum) -> Self
fn deserialize(buf: &[u8], discriminant: Self::BigNum) -> Self
Deserialization
Source§fn unsigned_deserialize_bignum(buf: &[u8]) -> Self::BigNum
fn unsigned_deserialize_bignum(buf: &[u8]) -> Self::BigNum
Deserializes a bignum from raw bytes. The bytes must be interpreted
as a big-endian unsigned integer.
Source§fn generator_for_discriminant(discriminant: Self::BigNum) -> Self
fn generator_for_discriminant(discriminant: Self::BigNum) -> Self
Generates a generator for the class group of
Self, given a
discriminant. Read moreSource§fn identity_for_discriminant(discriminant: Self::BigNum) -> Self
fn identity_for_discriminant(discriminant: Self::BigNum) -> Self
Computes the identity element of
Self for a given discriminant. Read moreSource§impl Clone for GmpClassGroup
impl Clone for GmpClassGroup
Source§fn clone(&self) -> GmpClassGroup
fn clone(&self) -> GmpClassGroup
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GmpClassGroup
impl Debug for GmpClassGroup
Source§impl Default for GmpClassGroup
impl Default for GmpClassGroup
Source§impl Hash for GmpClassGroup
impl Hash for GmpClassGroup
Source§impl<'a, B: Borrow<GmpClassGroup>> Mul<B> for &'a GmpClassGroup
impl<'a, B: Borrow<GmpClassGroup>> Mul<B> for &'a GmpClassGroup
Source§impl<B: Borrow<Self>> Mul<B> for GmpClassGroup
impl<B: Borrow<Self>> Mul<B> for GmpClassGroup
Source§impl<B: Borrow<GmpClassGroup>> MulAssign<B> for GmpClassGroup
impl<B: Borrow<GmpClassGroup>> MulAssign<B> for GmpClassGroup
Source§fn mul_assign(&mut self, rhs: B)
fn mul_assign(&mut self, rhs: B)
Performs the
*= operation. Read moreSource§impl Ord for GmpClassGroup
impl Ord for GmpClassGroup
Source§fn cmp(&self, other: &GmpClassGroup) -> Ordering
fn cmp(&self, other: &GmpClassGroup) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for GmpClassGroup
impl PartialEq for GmpClassGroup
Source§fn eq(&self, other: &GmpClassGroup) -> bool
fn eq(&self, other: &GmpClassGroup) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for GmpClassGroup
impl PartialOrd for GmpClassGroup
impl Eq for GmpClassGroup
impl StructuralPartialEq for GmpClassGroup
Auto Trait Implementations§
impl Freeze for GmpClassGroup
impl RefUnwindSafe for GmpClassGroup
impl Send for GmpClassGroup
impl Sync for GmpClassGroup
impl Unpin for GmpClassGroup
impl UnsafeUnpin for GmpClassGroup
impl UnwindSafe for GmpClassGroup
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more