dsa 0.7.0

Pure Rust implementation of the Digital Signature Algorithm (DSA) as specified in FIPS 186-4 (Digital Signature Standard), providing RFC6979 deterministic signatures as well as support for added entropy
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Key generation example.

#![cfg(feature = "hazmat")]

use dsa::{Components, KeySize, SigningKey};
use getrandom::{SysRng, rand_core::UnwrapErr};

fn main() {
    let mut rng = UnwrapErr(SysRng);
    let components =
        Components::try_generate_from_rng_with_key_size(&mut rng, KeySize::DSA_2048_256).unwrap();
    let signing_key =
        SigningKey::try_generate_from_rng_with_components(&mut rng, components).unwrap();
    let _verifying_key = signing_key.verifying_key();
}