Skip to main content

Crate crypto

Crate crypto 

Source
Expand description

Pure Rust cryptography with no_std support and hardware / SIMD acceleration for x86_64, aarch64 and WebAssembly.

§⚠️ Warning

This crate has not undergone a third-party security audit yet. Use at your own risk.

Modules§

aes
argon2
Argon2id (RFC 9106) password hashing function.
ascon
Ascon lightweight cryptography (NIST SP 800-232)
blake2
BLAKE2 Cryptographic Hash and Message Authentication Code (MAC) (RFC 7693).
blake3
BLAKE3: a fast cryptographic hash function with support for keyed hashing (MAC), key derivation and extendable output (XOF).
chacha
The ChaCha family of stream ciphers and AEADs.
curve25519
X25519 key exchange and Ed25519 signatures.
encoding
hkdf
HKDF (HMAC-based Extract-and-Expand Key Derivation Function) key derivation function.
hmac
HMAC (Hash-based Message Authentication Code)
mldsa
ML-DSA post-quantum signatures standardized in FIPS 204.
mlkem
ML-KEM post-quantum key encapsulation mechanism (KEM) standardized in FIPS 203.
p224
P-224 (secp224r1) ECDSA and ECDH.
p256
P-256 (secp256r1) ECDSA and ECDH.
p384
P-384 (secp384r1) ECDSA and ECDH.
p521
P-521 (secp521r1) ECDSA and ECDH.
pbkdf2
PBKDF2 (Password-Based Key Derivation Function 2) as defined in RFC 2898.
poly1305
Poly1305 MAC
random
rsa
RSA signature verification: PKCS#1 v1.5 and RSA-PSS (RFC 8017).
sha2
The SHA-2 family of hashing functions.
sha3
The SHA-3 family of hashing functions (FIPS 202 and NIST SP 800-185).
xwing
X-Wing: hybrid post-quantum key encapsulation mechanism (KEM) algorithm (ML-KEM-768 with X25519).

Structs§

Hash
A stack-allocated bytes buffer. Use Self::as_ref to get the bytes as a &[u8] and Self::as_mut to get the bytes as a &mut [u8]. Comparing Hash is a constant-time operation.

Enums§

AeadError
EllipticCurveError
HashError
Errors
HkdfError
RandomError
Error returned when the operating system’s random number generator fails.
RsaError

Constants§

MAX_HASH_OUTPUT_SIZE
Maximum output size supported by [Hash].

Traits§

Aead
Hasher
Zeroize is a no-op when the zeroize feature is not enabled.
StreamCipher
Xof
Zeroize