The `signature` test was too tightly coupled with the precise RNG output, in effect not just testing the DSA signature/verification logic but also testing that the exact bit sequence was produced by the dependent crate. We already have tests against deterministic keys and signatures at `tests/deterministic.rs`, so modify `tests/signature.rs` to instead generate a random keypair using the system RNG, then generate a signature with that keypair, and then verify that signature. The existing hard-coded signatures have been left in place as they are used to test PKCS decoding and encoding.
RustCrypto: Signatures

Support for digital signatures, which provide authentication of data using public-key cryptography.
All algorithms reside in the separate crates and implemented using traits from
the signature crate.
Crates are designed so they do not require the standard library (i.e. no_std)
and can be easily used for bare-metal or lightweight WebAssembly programming.
Crates
| Name | Algorithm | Crates.io | Documentation | Build |
|---|---|---|---|---|
dsa |
Digital Signature Algorithm | |||
ecdsa |
Elliptic Curve DSA | |||
ed25519 |
EdDSA for Curve25519 | |||
ed448 |
EdDSA for Curve448 | |||
lms |
Leighton-Micali Signature | |||
ml-dsa |
Module Lattice DSA | |||
rfc6979 |
Deterministic (EC)DSA Signatures | |||
slh-dsa |
Stateless Hash-Based Signature |
NOTE: for RSA signatures see https://github.com/RustCrypto/RSA
Usage
Crates functionality is expressed in terms of traits defined in the signature
crate.
License
All crates licensed under either of
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.