pub struct Cocks;Expand description
Namespace wrapper for the Cocks construction.
Implementations§
Source§impl Cocks
impl Cocks
Sourcepub fn from_primes(
p: &BigUint,
q: &BigUint,
) -> Option<(CocksPublicKey, CocksPrivateKey)>
pub fn from_primes( p: &BigUint, q: &BigUint, ) -> Option<(CocksPublicKey, CocksPrivateKey)>
Derive a raw key pair from explicit primes p and q.
Returns None if p >= q, the inputs are equal, either prime is
composite, or if
p is not invertible modulo q - 1.
Sourcepub fn generate<R: Csprng>(
rng: &mut R,
bits: usize,
) -> Option<(CocksPublicKey, CocksPrivateKey)>
pub fn generate<R: Csprng>( rng: &mut R, bits: usize, ) -> Option<(CocksPublicKey, CocksPrivateKey)>
Generate a Cocks key pair with p < q.
Auto Trait Implementations§
impl Freeze for Cocks
impl RefUnwindSafe for Cocks
impl Send for Cocks
impl Sync for Cocks
impl Unpin for Cocks
impl UnsafeUnpin for Cocks
impl UnwindSafe for Cocks
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