libcrux_ecdsa/
lib.rs

1//! # ECDSA
2//!
3//! A formally verified implementation of ECDSA on P-curves.
4//!
5//! For now only P-256 is supported.
6
7#![no_std]
8#![forbid(unsafe_code)]
9
10pub mod p256;
11
12#[derive(Debug, PartialEq, Eq, Clone, Copy)]
13pub enum Error {
14    InvalidInput,
15    InvalidScalar,
16    InvalidPoint,
17    NoCompressedPoint,
18    NoUnCompressedPoint,
19    SigningError,
20    InvalidSignature,
21    RandError,
22    UnsupportedHash,
23}
24
25/// The hash algorithm used for signing or verifying.
26pub type DigestAlgorithm = libcrux_sha2::Algorithm;
27
28/// The number of iteration for rejection sampling.
29#[cfg(feature = "rand")]
30pub(crate) const RAND_LIMIT: usize = 100;