core::crypto
이 페이지의 내용
- Modules
- Re-exports
- Enums
HashAlgorithm3- Functions
API 참조는 영어로만 있습니다. 표준 라이브러리 소스의 영어 문서 주석에서 만듭니다.
Cryptographic algorithms: pure computation, no OS (randomness is
std::random). Secret data is handled in constant time:
no branch or memory index depends on it.
Experimental: tested against NIST CAVP and Wycheproof vectors, not independently audited.
Modules
aeadAuthenticated encryption with associated data: AES-GCM (NIST SP 800-38D, 96-bit nonces) and ChaCha20-Poly1305 (RFC 8439).ecdsaECDSA (FIPS 186-5) on P-256 and P-384: verification, and signing with RFC 6979 deterministic nonces.ed25519Ed25519 (RFC 8032 5.1): pure EdDSA over edwards25519 with SHA-512.hkdfHKDF (RFC 5869) over anyHashAlgorithm:extracta pseudorandom key,expandit into output keying material.hmacHMAC (RFC 2104) over anyHashAlgorithm, SHA-2 or SHA-3.mlkemML-KEM-768 (FIPS 203): k = 3, eta1 = eta2 = 2, du = 10, dv = 4.rsaRSA (RFC 8017): PKCS #1 v1.5 and PSS verification and signing (MGF1 with the message hash), moduli of 2048 to 4096 bits.secretSecret storage: a buffer in the large-object space, so the collector never moves or copies it, zeroed bywipe, byusingrelease and by the collection that frees it (nabi_gc_secret_new).sha2SHA-2 (FIPS 180-4): SHA-256, SHA-384 and SHA-512.sha3SHA-3 (FIPS 202): SHA3-256, SHA3-512 and the SHAKE128 / SHAKE256 extendable-output functions, all over Keccak-f[1600].x25519X25519 (RFC 7748): Diffie-Hellman on Curve25519's u coordinate.
Re-exports
aead::{AeadAlgorithm, Aead}Source
pub use aead::{AeadAlgorithm, Aead}AeadAlgorithmThe AEAD ciphersAeadimplements.AeadA key ready forseal/open.
ecdsa::EcCurveSource
pub use ecdsa::EcCurveEcCurveThe elliptic curvesEcdsasigns over: NIST P-256 and P-384.
hmac::HmacSource
pub use hmac::HmacHmacA running HMAC.
secret::SecretSource
pub use secret::SecretSecretA fixed-length secret byte string.
sha2::DigestSource
pub use sha2::DigestDigestA running hash of aHashAlgorithm.
sha3::{Sha3_256, Sha3_512, Shake128, Shake256}Source
pub use sha3::{Sha3_256, Sha3_512, Shake128, Shake256}Enums
HashAlgorithmSource
pub enum HashAlgorithmA hash function chosen at run time (HMAC, HKDF, signatures, TLS).
The digest length in bytes.
The block length; for SHA-3 the sponge rate (HMAC's block).
The digest of
data:Digest::new,update,finish.
Functions
constant_time_eqSource
pub fn constant_time_eq<A: AsBytes, B: AsBytes>(a: A, b: B) -> bool Whether a and b are equal, in time that depends only on their
lengths.