Expand description
§moirai-crypto
Pure-Rust cryptographic primitives and an optional rustls::crypto::CryptoProvider.
The standalone SHA-256, HMAC-SHA256 and fixed-width comparison APIs are
available without enabling the provider feature. The default feature
enables the complete provider used by the Moirai TLS stack (moirai-tls).
All implementations use RustCrypto with
zero C dependencies.
With provider enabled, the crate supports the three TLS 1.3 cipher suites,
X25519 and P-256 key exchange, and the ECDSA/RSA signature verification
algorithms required to validate typical web PKI certificate chains — all
implemented in safe, portable Rust.
let provider = moirai_crypto::provider();Structs§
Functions§
- base64_
decode - Decodes padded standard RFC 4648 Base64.
- base64_
encode - Encodes bytes as standard RFC 4648 Base64 with padding.
- constant_
time_ eq_ 32 - Compares two 32-byte values without a source-level early exit.
- hmac_
sha256 - Computes HMAC-SHA256 according to RFC 2104.
- provider
- Construct a
CryptoProviderbacked by RustCrypto (no C dependencies). - sha1
- Computes the protocol-only SHA-1 digest of
data. - sha256
- Computes a SHA-256 digest in one pass.