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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//! Cryptographic digests and fast non-cryptographic hashes.
//!
//! This module is `no_std` compatible and has zero library dependencies outside
//! the rscrypto workspace. Dev-only dependencies are used for oracle testing
//! and benchmarking.
//!
//! # Quick Start
//!
//! ```rust
//! use rscrypto::{Digest, FastHash, Sha256, Shake256, Xof, Xxh3};
//!
//! let digest = Sha256::digest(b"hello");
//!
//! let mut streaming = Sha256::new();
//! streaming.update(b"he");
//! streaming.update(b"llo");
//! assert_eq!(streaming.finalize(), digest);
//!
//! let mut xof = Shake256::xof(b"hello");
//! let mut out = [0u8; 32];
//! xof.squeeze(&mut out);
//! assert_ne!(out, [0u8; 32]);
//!
//! let fast = Xxh3::hash(b"hello");
//! assert_ne!(fast, 0);
//! ```
//!
//! # Feature Selection
//!
//! Pick leaves for minimum size and bundles for category intent:
//!
//! ```toml
//! [dependencies]
//! # Smallest SHA-2-only build
//! rscrypto = { version = "0.1", default-features = false, features = ["sha2"] }
//!
//! # All cryptographic hashes
//! rscrypto = { version = "0.1", default-features = false, features = ["crypto-hashes"] }
//!
//! # Fast non-cryptographic hashes only
//! rscrypto = { version = "0.1", default-features = false, features = ["fast-hashes"] }
//!
//! # Everything hash-related
//! rscrypto = { version = "0.1", default-features = false, features = ["hashes"] }
//! ```
//!
//! # API Conventions
//!
//! - Fixed-output digests use `Type::digest(data)` for one-shot and `new` / `update` / `finalize` /
//! `reset` for streaming.
//! - XOFs use `Type::xof(data)` for one-shot and `finalize_xof()` for streaming squeeze readers.
//! - Fast hashes are one-shot only and implement [`crate::traits::FastHash`].
//!
//! # Modules
//!
//! - `crypto` - Cryptographic hash functions (safe by default).
//! - `fast` - Non-cryptographic hashes (**NOT CRYPTO**).
//! - `introspect` (requires `diag` feature) - Advanced kernel selection reporting.
//!
//! # Advanced
//!
//! Dispatch is automatic by default.
//!
//! - Use `crate::hashes::introspect` (requires `diag` feature) for kernel reporting and size-based
//! dispatch details.
//! - Use `crate::hashes::fast` for explicit fast-hash family access.
pub
// Re-export I/O adapters (requires std)
pub use ;
pub use crate;