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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
[]
= "argon2-rust"
= "1.1.0"
= "2024"
# Set by ONE thing: `stdarch_x86_avx512` (AVX-512 intrinsics + the `avx512f`
# target feature) stabilized in 1.89. Nothing else here needs newer than 1.88.
# Verified, not guessed — the `msrv` job in ci.yml builds with exactly this
# toolchain on x86_64 and aarch64. Raise it only with a reason.
= "1.89"
= "Pure-Rust port of the reference Argon2 implementation (phc-winner-argon2), with runtime-dispatched SIMD backends"
= "MIT"
= "https://github.com/Brooooooklyn/argon2-rust"
= "https://github.com/Brooooooklyn/argon2-rust"
= "https://docs.rs/argon2-rust"
= "README.md"
= ["/.github", "/benches", "/tests", "/fuzz", "/vm.sh", "/renovate.json"]
= ["argon2", "password-hash", "kdf", "simd", "crypto"]
= ["cryptography", "no-std"]
# Every bench target is declared explicitly below. Without this, Cargo would
# also auto-discover anything matching `benches/*.rs`, and `benches/support/`
# holds a module both benches `#[path]`-include rather than a bench of its own.
= false
[]
= true
= ["--cfg", "docsrs"]
# The library target is `argon2_rust` (dashes become underscores).
# Tests and benches use `use argon2_rust::...`.
[]
= ["std", "parallel", "zeroize-memory"]
# Enables runtime CPU feature detection (needs `std::arch::is_*_feature_detected!`).
# Without it, backend selection falls back to compile-time `target_feature` cfgs.
# Also turns on `memchr/std` so PHC field scans use its runtime SIMD cascade.
= ["memchr/std"]
# Multi-threaded `fill_memory_blocks` via `std::thread::scope`. Implies `std`.
= ["std"]
# Securely wipe internal buffers (mirrors `FLAG_clear_internal_memory` in core.c).
= []
# Internal benchmark/control for a reusable `bumpalo::Bump` inside `Workspace`.
# `Workspace` is reachable only through the unstable `internal-api`; enabling
# this feature alone does not change any stable hashing or encoding path. OFF BY
# DEFAULT ON PURPOSE — see the dependency note below for the measurement.
= ["dep:bumpalo"]
# Exposes `argon2_rust::__internal` so tests/benches can drive individual
# backends. Not part of the stable API; enabled for dev builds via the
# self-dev-dependency below.
= []
[]
# `memchr` is the one mandatory dependency: PHC `$` / `,` / `=` scans go
# through it so we do not maintain a second SIMD memchr. `default-features =
# false` keeps it `#![no_std]`; the `std` feature below turns on its runtime
# CPU detection, matching this crate's other cascades. Without `std` it uses
# compile-time `target_feature` cfgs, same as our fill/Base64/BLAKE2b.
= { = "2.8.3", = false }
# `bumpalo` is optional and off by default, and that is a measured decision,
# not timidity:
#
# * The hot path makes EXACTLY ONE heap allocation per hash (the block
# arena). At m=1 GiB it costs 1.7 us out of a 306 ms hash — 0.0006%. There
# is no allocator traffic there for a bump allocator to remove, and a
# `Bump` cannot hold the arena anyway: it is `!Sync`, and the parallel fill
# shares the arena across `std::thread::scope` workers.
# * Where a bump *does* win is the small encoding buffers. One hash's worth
# of them is 98 B + 51 B + 33 B, allocated and dropped inside the call.
# Measured here (interleaved A/B, min of 400 x 4096, control subtracted):
# 3x Vec::try_reserve + resize 24.30 ns
# 3x reused Bump + wiped reset 7.34 ns -17.0 ns
# Real, and worth 17 ns per hash. That is 0.16% of the smallest Argon2
# hash that exists (m=8 KiB, 10.75 us) and 0.00013% of an RFC 9106 hash
# (m=64 MiB), i.e. four orders of magnitude below this machine's 1-9%
# run-to-run noise.
# * Only a long-lived, reset-between-uses bump is ahead. `Bump::new()` plus
# one 98 B buffer costs 18.5 ns against that `Vec`'s 9.0 ns, so a fresh
# bump per call is a regression. The benchmark control therefore keeps its
# bump inside a reusable `Workspace`.
#
# 17 ns does not justify a second stable-path dependency. It does justify
# retaining the measured counterfactual for internal tests and benches.
# Hence: optional, default off, and not wired into `Hasher` or the encoding API.
#
# `default-features = false` is belt and braces: bumpalo's default feature set
# is already empty (verified in bumpalo-3.20.3/Cargo.toml) and it is
# `#![no_std]` unless its own `std` feature is on, so this is exactly the
# no_std + alloc configuration this crate needs.
= { = "3.20.3", = false, = true }
[]
# Self-dev-dependency: makes `cargo test` / `cargo bench` build the lib with
# `internal-api` on, without leaking it into a plain `cargo build`.
# `default-features = false` keeps `cargo test --no-default-features` honest.
= { = ".", = false, = ["internal-api"] }
# Criterion (through rayon) does not build for wasi, and no bench or test
# target runs there anyway — `cargo test --target wasm32-wasip1` covers the
# library and the integration tests, never the benches.
[]
= "5.0.1"
= { = "0.8", = ["html_reports"] }
[[]]
= "argon2"
= false
# The CI regression net, measured by CodSpeed's simulation instrument. Small,
# hermetic and single-threaded on purpose — see the module docs in
# `benches/codspeed.rs` for why it does not simply reuse the sweep above.
[[]]
= "codspeed"
= false
# The fast iteration harness. Criterion is the right tool for a publishable
# number and the wrong one for a five-second edit-measure loop, so this is a
# plain `fn main()` that times `fill_memory_blocks` directly. See the module
# docs in `benches/micro.rs` for the invocation.
[[]]
= "micro"
= false
# Isolates the three BLAKE2b shapes Argon2 actually uses and compares every
# executable compression backend against scalar in the same process.
[[]]
= "blake2b"
= false
# Isolates the PHC string's unpadded standard-Base64 codec. The production
# hash sizes are deliberately included alongside larger buffers so a SIMD
# backend cannot look good only on bulk data it never sees in normal Argon2
# records.
[[]]
= "base64"
= false
# Dependency-free paired scalar/SIMD timing harness. Unlike the Criterion
# sweep above, this also runs under Wasmtime and inside minimal Linux
# containers, and reports both the production auto-dispatch path and each
# executable backend explicitly.
[[]]
= "base64_shootout"
= false
# Resident-set-size checks, which are a property of a *process* and therefore
# cannot live in a libtest binary: `cargo test` runs that binary's tests
# concurrently in one process, so `ps -o rss=` charges every sibling's
# allocations to whichever test happens to be sampling. It did exactly that, and
# failed the x86_64 gate deterministically, while the library allocated nothing.
# `harness = false` makes this file its own `fn main()` in its own process, so
# the measurement is contamination-free by construction rather than by slack.
[[]]
= "rss_isolation"
= false
[]
= 3
= "thin"
= 1
# `panic` deliberately left at the default: the library must not panic on any
# input reachable through the public API, so `abort` would buy nothing and it
# would break `cargo test`.
[]
= 3
= "thin"
= 1