pub struct Params { /* private fields */ }
Expand description
Public parameters for DSA signatures.
DSA uses the ring Z/pqZ (p,q are primes) and a generator g
of that group.
Implementations§
source§impl Params
impl Params
sourcepub fn new(p: &[u8], q: &[u8], g: &[u8]) -> Params
pub fn new(p: &[u8], q: &[u8], g: &[u8]) -> Params
Create a new DSA parameter structure with primes p
and q
and generator g
.
sourcepub fn generate<R: Random>(
random: &mut R,
p_bits: usize,
q_bits: usize
) -> Result<Params>
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.
Trait Implementations§
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§
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