Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
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
386bbe3
Remediated documentation and test concerns (#119)
officialfrancismendoza Sep 18, 2026
3d265ad
Merge remote-tracking branch 'origin/feature/xof-cshake' into feature…
dghgit Sep 20, 2026
6d849a1
cli, ascon: document the generated-nonce stream layout and the 8 MiB …
dghgit Sep 20, 2026
bbc04e3
release notes: the current bouncycastle-ascon mutation figures (#119)
dghgit Sep 20, 2026
2f7c32a
core, core-test-framework, ascon: delete the AEADCipher trait, supers…
dghgit Sep 20, 2026
80098c4
release notes: record the AEADCipher removal and re-measure the mutat…
dghgit Sep 20, 2026
702246a
core, core-test-framework, ascon, cli: carry the inline ciphertext||t…
dghgit Sep 20, 2026
c8190be
release notes: re-measure bouncycastle-ascon after the AEAD trait cha…
dghgit Sep 20, 2026
f376c14
core, core-test-framework: close the mutation gaps a scoped run found…
dghgit Sep 20, 2026
a1468a9
release notes: record the scoped mutation figures for the AEAD trait …
dghgit Sep 20, 2026
ac72292
Merge branch 'feature/xof-cshake' into feature/officialfrancismendoza…
dghgit Sep 21, 2026
62e6a2b
docs: fix contributing typos
officialfrancismendoza Sep 21, 2026
336f9cb
core, core-test-framework, ascon, cli: make AEADCipherEncryptor/AEADC…
dghgit Sep 24, 2026
2eb7a99
ascon: add Ascon_AEAD128<Dir>, naming the AEAD pair by direction
dghgit Sep 24, 2026
c89663a
Merge remote-tracking branch 'origin/feature/xof-cshake' into trial/c…
dghgit Sep 24, 2026
570ae03
Initial add of AES lightweight CCM mode (#125)
officialfrancismendoza Sep 10, 2026
5d5cf5c
core, modes: document why AEADCipherEncryptor/Decryptor were not resh…
officialfrancismendoza Sep 14, 2026
3dd3266
cli: --nonce-file for CCM reads raw bytes only, never hex-decodes
officialfrancismendoza Sep 15, 2026
3be43fb
modes, core: zeroize CCM's CBC-MAC state, and make BUFFER_LEN vs the …
officialfrancismendoza Sep 15, 2026
e95a25b
modes: batch CCM's CTR half, and fix docs that claimed it was impossible
officialfrancismendoza Sep 15, 2026
9f437ab
cli: stop BlockModeAction's shared help from describing behaviour CCM…
officialfrancismendoza Sep 15, 2026
4282833
cli: process CCM input in place instead of allocating a second buffer
officialfrancismendoza Sep 15, 2026
ac13ce0
modes: dedupe CcmEncryptor/CcmDecryptor over a shared CcmBuffer, drop…
officialfrancismendoza Sep 15, 2026
e877a32
modes: add a Wycheproof AES-CCM suite, move/drop CCM unit tests that …
officialfrancismendoza Sep 15, 2026
1b593c5
modes: close the mutation-testing gaps the batching and buffer-bounda…
officialfrancismendoza Sep 15, 2026
afa2b3c
modes: adapt CCM buffer errors to the #120 API
officialfrancismendoza Sep 21, 2026
8a24373
Fixed formatting with cargo fmt (#125)
officialfrancismendoza Sep 21, 2026
24a646c
Remediated concerns. F1-F10 fixed except F9 (optional), which was lef…
officialfrancismendoza Sep 23, 2026
67a7b45
modes, aes, core-test-framework: port CcmEncryptor/CcmDecryptor to th…
dghgit Sep 24, 2026
52e63bc
Merge branch 'feature/xof-cshake' into feature/officialfrancismendoza…
dghgit Sep 25, 2026
d05e50e
Merge remote-tracking branch 'bcgit/feature/xof-cshake' into feature/…
officialfrancismendoza Sep 27, 2026
dd4e5f6
Merge remote-tracking branch 'origin/feature/officialfrancismendoza/1…
officialfrancismendoza Sep 27, 2026
2161a04
Fix batched keystream left on stack (#125)
officialfrancismendoza Sep 27, 2026
985eb94
modes: zeroize CTR's batched and single-block keystream, as 2161a04 d…
dghgit Sep 27, 2026
6a061ed
modes: CCM review fixes -- decryptor nonce floor, one error variant f…
dghgit Sep 27, 2026
f527ac9
aes: AES_CCM_*_Encryptor docs -- the nonce floor applies to the decry…
dghgit Sep 27, 2026
5de0f7d
cli: aes*-ccm -- warn on a nonce file ending in a newline, and explai…
dghgit Sep 27, 2026
30b871b
mem_usage_benches: make the CCM harness measure the streaming path it…
dghgit Sep 27, 2026
68a8934
aes: drop the redundant explicit link targets in the CCM module docs
dghgit Sep 27, 2026
174563c
mem_usage_benches: state the CCM streaming figures against the baseli…
dghgit Sep 27, 2026
840bf42
Merge remote-tracking branch 'origin/feature/xof-cshake' into feature…
dghgit Sep 27, 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
6 changes: 5 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ Repo mechanics behind those rules, which the documents don't spell out:
- `./dev_scripts/quality_stats.sh` produces the fallibility metrics both documents ask you to check. Run it before
and after a change and compare, rather than eyeballing the diff.
- **CLI commands stream.** The `cli/` binary is stdin→stdout with ~1 KB buffers so commands compose in shell
pipelines; preserve that when adding subcommands.
pipelines; preserve that when adding subcommands. The exception is a construction that is not
itself streamable, such as CCM (SP 800-38C Sec 3: "CCM is not designed to support partial
processing or stream processing", because the payload length is inside the first block the MAC
covers) -- there, read the whole input once and process it in place, rather than adding a second
buffer the size of the input on top of it; see `aes_ccm_cmd.rs`.
- Trait → factory → CLI is the wiring path for a new primitive; see [the workspace architecture](#the-core--core-test-framework--factory-spine) above for the crates involved.

## Scope of changes
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Some specifics:
* Public APIs of a library should be both ergonomic and expressive. When defining a new trait or public function, ask
yourself whether a programmer who is new to cryptography is likely to use this in a way that will get them into
trouble.
* Variables should be well-named, well-structured, and well-commented (a comment-to-code ration of 1:1 is a goal to be
* Variables should be well-named, well-structured, and well-commented (a comment-to-code ratio of 1:1 is a goal to be
strived for!). Think about memory footprint and, where possible, use unnamed scopes to allow the compiler to pop
intermediate value variables off the stack as soon as they are no longer needed.
* Always run your code through `cargo mutants` and get the issue count as low as your can. As a first pass, this forces
* Always run your code through `cargo mutants` and get the issue count as low as you can. As a first pass, this forces
you to write thorough unit tests. As a second pass, this draws your attention to bits of your code that cannot be
tested from the outside. Often this means that the code can be simplified without affecting functionality (as defined
by your set of unit tests) -- "simpler code" usually means faster runtime and easier future maintenance.
Expand All @@ -71,7 +71,7 @@ For minor updates, you can instead choose to create an issue with short snippets

* For contributions touching multiple files try and split up the pull request, smaller changes are easier to review and
test, as well as being less likely to run into merge issues.
* Create a test cases for your change, it may be a simple addition to an existing test. If you do not know how to do
* Create test cases for your change; it may be a simple addition to an existing test. If you do not know how to do
this, ask us and we will help you.
* If you run into any merge issues, check out this [git tutorial](https://github.com/skills/resolve-merge-conflicts) to
help you resolve merge conflicts and other issues.
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
40 changes: 40 additions & 0 deletions alpha_0.1.3_release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,46 @@
* New algorithms added to crypto/ :
* SM3 -- the SM3 hash (GB/T 32905-2016 / ISO/IEC 10118-3:2018), ported from bc-java.
* AES -- AES-128/192/256, along with its modes AES_ECB, AES_CBC, AES_GCM.
* ASCON -- Ascon-AEAD128, Ascon-Hash256, Ascon-XOF128 and Ascon-CXOF128 (NIST SP 800-232).
`AsconAead128Encryptor` / `AsconAead128Decryptor` implement the generated-nonce
`AEADCipherEncryptor` / `AEADCipherDecryptor` pair; the inherent `AsconAead128` API keeps the
explicit-nonce, in-place streaming form (`new_encrypting` / `new_decrypting`).
`Ascon_AEAD128<Dir>` names the pair by direction (`Ascon_AEAD128<Encrypting>` /
`Ascon_AEAD128<Decrypting>`).
* `bouncycastle-ascon` is re-exported as `bouncycastle::ascon`; `Ascon-Hash256` and
`Ascon-XOF128` are registered in the factories, and the CLI adds `ascon-hash256`,
`ascon-xof128`, `ascon-cxof128` and `ascon-aead128`. The AEAD command generates and prefixes
the nonce by default, with `--nonce`/`--nonce-file` retained for deterministic vectors.
Streaming decrypt releases plaintext before the final tag check, so callers must discard any
output if finalization or the CLI exit status reports authentication failure.
* `core` gains the streaming AEAD split: `AEADCipherEncryptor<KEY_LEN, NONCE_LEN, TAG_LEN,
FINAL_LEN>` and `AEADCipherDecryptor<...>`, which extend `SymmetricCipherEncryptor<KEY_LEN,
NONCE_LEN, FINAL_LEN>` / `SymmetricCipherDecryptor<...>`. The inherited methods are the AEAD
with no associated data and the tag inline (`ciphertext || tag`), so an AEAD can be held and
used as a plain symmetric cipher; `FINAL_LEN` is the tag plus anything the cipher holds back,
and every decryptor holds back the last `TAG_LEN` bytes it has seen, since it cannot know which
layout its final call will ask for. The AEAD traits add `do_update_aad`; the detached-tag
methods, each named for the base method it mirrors plus `_detached` (`do_final_detached` /
`do_final_out_detached`, `encrypt_out_detached`, `encrypt_out_rng_detached`, `encrypt_detached`,
`decrypt_out_detached`, `decrypt_detached` and the `*_len_detached` sizing helpers); and the
inline-tag one-shots with AAD, named for their base method plus `_with_aad`
(`encrypt_out_with_aad`, `encrypt_out_rng_with_aad`, `encrypt_with_aad`, `decrypt_out_with_aad`,
`decrypt_with_aad`).
`SymmetricCipherDecryptor::decrypt_out` now zeroizes what it wrote when `do_final` fails, as the
AEAD one-shots always have.
The older single-type `core::traits::AEADCipher`, which this splits and which had no
implementors, is removed, along with its `core-test-framework` suites
(`TestFrameworkAEADCipher::test` / `::test_plain_one_shots`).
Mutation testing of the pair's defaults (`traits.rs`, scoped to `AEADCipher{En,De}cryptor` and
`SymmetricCipherDecryptor::decrypt_out`, tested through `bouncycastle-core` +
`bouncycastle-ascon`) reports 134 mutants, 107 caught, 27 unviable and none missed; the
`AsconAead128Encryptor` / `AsconAead128Decryptor` adapters report 76 mutants, 49 caught, 27
unviable and none missed.
* ASCON testing covers the NIST LWC KAT sweeps from `bc-test-data` (1089 AEAD128, 1025 Hash256,
1025 XOF128 and 1089 CXOF128 cases when the data repository is present), plus embedded always-on
vectors. Mutation testing for `bouncycastle-ascon` reports 661 mutants, 558 caught, 97 unviable
and 6 missed; the six survivors are the sponge boundary and `set_state_byte` OR/XOR equivalences
documented at their sites.

## Minor features / bug fixes

Expand Down
Loading
Loading