1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// SPDX-License-Identifier: Apache-2.0
// Copyright 2026 Cédric Mesnil <cslashm@pm.me>
//! `krypteia-tessera` — shared pure-Rust hash primitives for the krypteia
//! workspace.
//!
//! One home for every hash, XOF, keyed construction, KDF and checksum the
//! workspace needs — SHA-2, SHA-3 / Keccak, the SHAKE / cSHAKE XOFs, MGF1,
//! the legacy/alt family (SHA-1, RIPEMD-160, BLAKE2b/2s, BLAKE3), HMAC, the
//! SP 800-185 keyed constructions (KMAC, TupleHash, ParallelHash), the KDF
//! family (HKDF, PBKDF2, SP 800-108, scrypt, Argon2) and the
//! non-cryptographic CRC-16/32 checksums — so that `quantica` (post-quantum)
//! and `arcana` (classical) stop carrying their own copies. The granularity
//! (one crate rather than per-family) follows the survey of the Rust
//! crypto ecosystem recorded for v0.2.
//!
//! `no_std`, no runtime dependencies. Constant-timeness is **not** a goal
//! of the hash compression functions themselves (their inputs are public
//! data); secret-dependent comparison/zeroization stays in `silentops`. The
//! memory-hard KDFs process a **secret** password and are **not**
//! constant-time: scrypt (ROMix) and Argon2d/Argon2id use **data-dependent**
//! memory addressing driven by the password (Argon2i is the data-independent
//! variant). This is inherent to the constructions and documented by design,
//! not a defect; see each module's `# Side-channel posture`.
//!
//! # Roadmap (this crate is built in stages)
//!
//! 1. traits ([`Digest`], [`Xof`]) — done.
//! 2. SHA-3: Keccak-f, SHA3-224/256/384/512, SHAKE128/256, cSHAKE — done.
//! 3. SHA-2: SHA-224/256/384/512/512-224/512-256, MGF1 — done.
//! 4. legacy/alt family: SHA-1, RIPEMD-160, BLAKE2b/2s, BLAKE3 — done.
//! 5. quantica migrates onto this crate for Keccak (hot path; benchmarked).
//! 6. arcana migrates onto this crate for SHA-2/SHA-3 and the legacy family.
//! 7. keyed constructions: HMAC, the SP 800-185 family (KMAC, TupleHash,
//! ParallelHash) — done.
//! 8. KDF family: HKDF, PBKDF2, SP 800-108 (KBKDF) and the memory-hard
//! scrypt / Argon2 password hashes — done.
//! 9. non-cryptographic CRC-16/32 checksums (no `Digest` impl) — done.
extern crate alloc;
pub use argon2;
pub use ;
pub use ;
// CRC engines + algorithm types. The named parameter-set consts stay under
// `crc::` (e.g. `crc::CRC32_ISO_HDLC`) to keep the crate root uncluttered.
// CRC is a non-cryptographic checksum and deliberately does not impl `Digest`.
pub use ;
pub use ;
pub use mgf1;
// PBKDF2 as a root free fn (mirrors `mgf1`); HKDF's extract/expand/derive stay
// under `hkdf::` because those names are too generic for the crate root.
pub use pbkdf2;
pub use Ripemd160;
pub use scrypt;
pub use Sha1;
pub use ;
pub use ;
pub use ;
pub use ;