Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3912434
core: SecurityStrength::from_bits and from_bytes become const fn, so …
dghgit Sep 16, 2026
785dbef
sha2: SHA512t becomes usable for every t FIPS 180-4 s. 5.3.6 defines …
dghgit Sep 16, 2026
4053f21
core, sha3: XOF extends Hash, so SHAKE128 and SHAKE256 are hashes; sq…
dghgit Sep 7, 2026
86819d7
sha3: pin the SHAKE block_bitlen and output_len values, which three m…
dghgit Sep 7, 2026
24ae9b4
core: XofOutput gains do_final and do_final_out, matching BC Java's d…
dghgit Sep 7, 2026
517cd59
sha3: add cSHAKE128 and cSHAKE256 (SP 800-185 Sec 3) with the Sec 2.3…
dghgit Sep 7, 2026
61d3d8e
docs: record the cargo mutants scoping flags, the bc-test-data conven…
dghgit Sep 7, 2026
63ca433
sha3: add KMAC128 and KMAC256 (SP 800-185 Sec 4) with KMACXOF, MACFac…
dghgit Sep 7, 2026
3adbfc1
core: drop the Default supertrait from Hash, so keyed constructions c…
dghgit Sep 7, 2026
b1fff3c
sha3: KMACXOF128 and KMACXOF256 as keyed XOFs, now that Hash no longe…
dghgit Sep 7, 2026
9efbf5f
core-test-framework: the XOF suite takes a constructor closure, so ke…
dghgit Sep 7, 2026
3913b55
sha3: add TupleHash and TupleHashXOF (SP 800-185 Sec 5), where each u…
dghgit Sep 7, 2026
90bd179
sha3: add ParallelHash and ParallelHashXOF (SP 800-185 Sec 6), comple…
dghgit Sep 7, 2026
5c6302a
cli: add tuplehash and parallelhash subcommands, completing SP 800-18…
dghgit Sep 7, 2026
68a3dbc
sha3: pin the Hash and XOF trait views of TupleHash, ParallelHash and…
dghgit Sep 7, 2026
50c125b
factory: replace the todo stub in xof_factory_tests with a differenti…
dghgit Sep 7, 2026
b95dd0c
core: Hash gains Clone as a supertrait, so a hash mid-stream can be f…
dghgit Sep 9, 2026
6707002
core: XOF gains default hash_xof and hash_xof_out bodies so only SHAK…
dghgit Sep 10, 2026
b466d95
core-test-framework: add test_hash_output_buffers, a closure-built Ha…
dghgit Sep 10, 2026
0e8b2f7
sha3: TupleHash and ParallelHash panicked on an output buffer shorter…
dghgit Sep 10, 2026
ad3fa52
core: drop XOFOutput::do_final and do_final_out, which no implementor…
dghgit Sep 10, 2026
8810ae7
core, core-test-framework, sha3, factory, mldsa, mlkem, cli: rename t…
dghgit Sep 14, 2026
0a2bb8f
core, core-test-framework, sha3: a final read of a XOF binds its outp…
dghgit Sep 14, 2026
8a46683
CLAUDE.md: record the cargo mutants mechanics this repo needs, since …
dghgit Sep 14, 2026
b5fcf99
core, core-test-framework: AEADCipherEncryptor/AEADCipherDecryptor ga…
officialfrancismendoza Sep 9, 2026
120b2fe
ascon, cli: add bouncycastle-ascon (SP 800-232 Ascon-AEAD128/Hash256/…
officialfrancismendoza Sep 9, 2026
2c479f4
Rebased #120 onto #118. Ported ASCON XOF/CXOF to new Hash/XOF/XOFSque…
officialfrancismendoza Sep 17, 2026
465e684
Minor doc fix to lib.rs given new XOF api (#119)
officialfrancismendoza Sep 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,15 @@ Quality / mutation testing:

```
./dev_scripts/quality_stats.sh ./crypto # lines-of-code, docstring & fallibility metrics; CI publishes this
cargo mutants # config in .cargo/mutants.toml (output: custom_mutants_output/)
cargo mutants -p bouncycastle-sha3 # config in .cargo/mutants.toml (output: custom_mutants_output/)
```

`-p` is as non-optional here as `--workspace` is for build and test, and for the same reason: a bare
`cargo mutants` examines only the root `bouncycastle` package, whose single `src/lib.rs` yields no
mutants, so it prints "No mutants found under the active filters" and exits **0**. See
[the mutation-testing mechanics](#notes-on-testing) for scoping a run to one file, for crates whose
tests live elsewhere, and for the test-data symlink.

Stack-memory benches are separate binaries under `mem_usage_benches/src/`, each declared as a
`[[bin]]` in that crate's `Cargo.toml`:

Expand Down Expand Up @@ -165,7 +171,11 @@ Rules when working from the downloaded copy:
What a crate must be tested against — including the mutation-testing expectation, the trait test framework, and the
external vector suites — is specified in QUALITY_AND_STYLE.md and CONTRIBUTING.md. Repo-specific mechanics:

- `cargo mutants` is expected to be run on each crate; surviving mutants must be investigated but not all need to die (e.g. XOR/OR equivalences in crypto code are acceptable). Config lives in `.cargo/mutants.toml` (output dir `custom_mutants_output/`).
- `cargo mutants` is expected to be run on each crate; surviving mutants must be investigated but not all need to die (e.g. XOR/OR equivalences in crypto code are acceptable). Config lives in `.cargo/mutants.toml` (output dir `custom_mutants_output/`). Four things about running it here:
- **Always pass `-p <crate>`.** Without it only the root package is examined, which has no mutants, and the run "passes" vacuously — see [Common commands](#common-commands).
- **`-f`/`--file` does nothing while the checked-in config is in play**, because its `examine_globs` wins over the CLI filter: `cargo mutants -p bouncycastle-sha3 -f '**/kmac.rs'` still examines all ~874 mutants in the crate. To scope a run to the files you changed, copy `.cargo/mutants.toml` somewhere outside the repo, delete its `examine_globs` block, and pass `--config <copy>`; `-f` then filters as documented. (`--config /dev/null` also works but throws away `skip_calls`, `error_values`, `cap_lints` and the timeout multipliers with it.)
- **Add `--test-workspace true` when a crate's mutants are killed by another crate's tests.** The `core` traits are the case that matters: their default method bodies are exercised from `sha3` and `factory`, so a `-p bouncycastle-core` run alone reports them all as missed.
- **Symlink the test data into `/tmp`.** `cargo mutants` copies the tree to `/tmp/cargo-mutants-<dir>-XXXX.tmp/`, so the `../../../bc-test-data/...` paths the vector suites use resolve to `/tmp/bc-test-data`. Without `ln -s <path-to>/bc-test-data /tmp/bc-test-data` those tests print their "not found" warning, pass vacuously, and every mutant they would have killed is reported as missed. Use `--jobs 3` and an explicit `--timeout`; note that a mutant which makes a squeeze return no bytes hangs a fill loop for real, so some timeouts are kills rather than false alarms.
- Integration tests in `tests/` are preferred over in-file `#[cfg(test)] mod tests` blocks — see "Unit tests vs integration tests" in QUALITY_AND_STYLE.md for the reasoning and the exceptions. A unit test is justified for high-risk code that has known-answer values and cannot be reached through the public API; when you write one, all of its helpers go inside that `mod tests`.
- A property that can be asserted at compile time (`const _: () = assert!(...)`) stays a compile-time assertion even when a test also covers it: `cargo mutants` cannot see a const assertion fail, so pair the two rather than trading the guarantee for the coverage.
- For traits in `core`, the canonical tests live in `core-test-framework` and are invoked from each implementor's integration tests — don't duplicate them per-implementation.
Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ version = "0.1.3"
# *** Internal Dependencies ***
bouncycastle = { path = "./" }
bouncycastle-aes = { path = "./crypto/aes" }
bouncycastle-ascon = { path = "./crypto/ascon" }
bouncycastle-base64 = { path = "./crypto/base64" }
bouncycastle-modes = { path = "./crypto/modes" }
bouncycastle-core = { path = "crypto/core" }
Expand Down Expand Up @@ -46,6 +47,7 @@ edition.workspace = true

[dependencies]
bouncycastle-aes.workspace = true
bouncycastle-ascon.workspace = true
bouncycastle-base64.workspace = true
bouncycastle-core.workspace = true
bouncycastle-factory.workspace = true
Expand Down
Loading
Loading