smgw_sec/lib.rs
1#![cfg_attr(not(feature = "openssl"), no_std)]
2#![forbid(unsafe_code)]
3#![doc = include_str!("../README.md")]
4
5/// An already commissioned Brainpool P-256 public key for verifying ECDSA/SHA-256.
6///
7/// Implementations must bind the key to the brainpoolP256r1 curve before use.
8/// Hash the original message bytes once with SHA-256. Each signature component
9/// is an unsigned 32-byte big-endian integer. Return `Ok(true)` only for a valid
10/// signature under the bound key, `Ok(false)` for a mismatch, or an error if
11/// the provider could not perform verification.
12pub trait BrainpoolP256Verifier {
13 type Error: core::error::Error + 'static;
14
15 fn verify(&mut self, message: &[u8], r: &[u8; 32], s: &[u8; 32]) -> Result<bool, Self::Error>;
16}
17
18/// OpenSSL implementation of the Brainpool signature profile.
19#[cfg(feature = "openssl")]
20pub mod openssl;
21
22/// Provisioned identities for OpenSSL TLS endpoints.
23#[cfg(feature = "openssl")]
24pub mod tls;
25
26#[cfg(feature = "async-tls")]
27pub mod transport;