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
The BLAKE3 cryptographic hash function with support for ultra-fast hashing, 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
HMAC (Hash-based Message Authentication Code)
hmac
HKDF (HMAC-based Extract-and-Expand Key Derivation Function) key derivation function.
mldsa
ML-DSA post-quantum signatures standardized in FIPS 204.
mlkem
ML-KEM post-quantum key encapsulation mechanism (KEM) standardized in FIPS 203.
p256
p384
pbkdf2
PBKDF2 (Password-Based Key Derivation Function 2) as defined in RFC 2898.
poly1305
Poly1305 MAC
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
Errors
EllipticCurveError
HkdfError
RsaError

Traits§

Aead
Hasher
StreamCipher
Traits
Xof
Zeroize

Functions§

random_bytes
Returns an array filled with cryptographically-random data.
random_fill
Fill the given buffer with cryptographically-random data.