[][src]Struct nettle::dsa::Params

pub struct Params { /* fields omitted */ }

Public parameters for DSA signatures.

DSA uses the ring Z/pqZ (p,q are primes) and a generator g of that group.


impl Params[src]

pub fn new(p: &[u8], q: &[u8], g: &[u8]) -> Params[src]

Create a new DSA parameter structure with primes p and q and generator g.

pub fn generate<R: Random>(
    random: &mut R,
    p_bits: usize,
    q_bits: usize
) -> Result<Params>

Generates a fresh set of parameters.

p_bits and q_bits are the size of the primes. FIPS-186 expects q_bits = 160 and p_bits = 512 + 64l for l = [0-8]. The Nettle documentation recommends 1024.

pub fn primes(&self) -> (Box<[u8]>, Box<[u8]>)[src]

Returns the primes p and q ad big endian integers.

pub fn g(&self) -> Box<[u8]>[src]

Returns the generator g as big endian integer.

Trait Implementations

impl Clone for Params[src]

impl Drop for Params[src]

Auto Trait Implementations

impl RefUnwindSafe for Params

impl !Send for Params

impl !Sync for Params

impl Unpin for Params

impl UnwindSafe for Params

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.