Struct classgroup::gmp_classgroup::GmpClassGroup
source · 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) -> Uwhere
T: FnOnce(&mut Ctx) -> U,
pub fn with_context<T, U>(cb: T) -> Uwhere
T: FnOnce(&mut Ctx) -> 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. Read more
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 copy of the value. Read more
1.0.0 · 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 · 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<GmpClassGroup> for GmpClassGroup
impl PartialEq<GmpClassGroup> for GmpClassGroup
source§fn eq(&self, other: &GmpClassGroup) -> bool
fn eq(&self, other: &GmpClassGroup) -> bool
source§impl PartialOrd<GmpClassGroup> for GmpClassGroup
impl PartialOrd<GmpClassGroup> for GmpClassGroup
source§fn partial_cmp(&self, other: &GmpClassGroup) -> Option<Ordering>
fn partial_cmp(&self, other: &GmpClassGroup) -> Option<Ordering>
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 more