pub struct Dh;Implementations§
Source§impl Dh
impl Dh
Sourcepub fn generate_params<R: Csprng>(rng: &mut R, bits: usize) -> Option<DhParams>
pub fn generate_params<R: Csprng>(rng: &mut R, bits: usize) -> Option<DhParams>
Generate domain parameters (p, q, g) for a given key size.
Uses the same prime-order subgroup generation as DSA (FIPS 186-5). The parameters can be reused across many key pairs.
Sourcepub fn generate<R: Csprng>(
params: &DhParams,
rng: &mut R,
) -> (DhPublicKey, DhPrivateKey)
pub fn generate<R: Csprng>( params: &DhParams, rng: &mut R, ) -> (DhPublicKey, DhPrivateKey)
Generate a DH key pair from existing domain parameters.
Auto Trait Implementations§
impl Freeze for Dh
impl RefUnwindSafe for Dh
impl Send for Dh
impl Sync for Dh
impl Unpin for Dh
impl UnsafeUnpin for Dh
impl UnwindSafe for Dh
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