signature/lib.rs
1#![no_std]
2#![cfg_attr(docsrs, feature(doc_cfg))]
3#![doc = include_str!("../README.md")]
4#![doc(
5 html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg",
6 html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg"
7)]
8#![forbid(unsafe_code)]
9#![allow(async_fn_in_trait)]
10
11//! # Design
12//!
13//! This crate provides a common set of traits for signing and verifying digital signatures intended
14//! to be implemented by libraries which produce or contain implementations of digital signature
15//! algorithms, and used by libraries which want to produce or verify digital signatures
16//! generically.
17//!
18//! ## Unstable features
19//!
20//! Despite being post-1.0, this crate includes off-by-default unstable optional features, each of
21//! which depends on a pre-1.0 crate.
22//!
23//! These features are considered exempt from SemVer. See "SemVer Policy Exemptions" for more
24//! information.
25//!
26//! The following unstable features are presently supported:
27//!
28//! - `digest`: enables the [`DigestSigner`] and [`DigestVerifier`] traits which are based on the
29//! [`Digest`] trait from the [`digest`] crate.
30//! - `rand_core`: enables the [`RandomizedSigner`] trait for signature systems which rely on a
31//! cryptographically secure random number generator for security.
32//!
33//! [`digest`]: https://docs.rs/digest/
34//! [`Digest`]: https://docs.rs/digest/latest/digest/trait.Digest.html
35
36#[cfg(feature = "alloc")]
37extern crate alloc;
38
39pub mod hazmat;
40
41mod encoding;
42mod error;
43mod keypair;
44mod signer;
45mod verifier;
46
47#[cfg(feature = "digest")]
48pub use digest;
49
50pub use crate::{encoding::*, error::*, keypair::*, signer::*, verifier::*};
51
52#[cfg(feature = "rand_core")]
53pub use rand_core;