Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
ab991ee
Scaffold bouncycastle-rsa crate
dghgit Sep 19, 2026
f7f2f12
rsa: constant-time modular exponentiation over a runtime modulus
dghgit Sep 19, 2026
182eb3c
rsa: CRT key types and RSASP1/RSAVP1 (RFC 8017 SS5.2)
dghgit Sep 19, 2026
c27655f
rsa: RSASSA-PKCS1-v1_5 sign/verify for RSA-2048/SHA-256
dghgit Sep 19, 2026
9175cb9
rsa: RSASSA-PSS sign/verify for RSA-2048/SHA-256
dghgit Sep 19, 2026
921f65e
rsa: SHA-384 and SHA-512 for RSA-2048 (PKCS#1 v1.5 and PSS)
dghgit Sep 19, 2026
80f38fc
rsa: RSA-1024, 1536, 3072, 4096, and 8192 (PKCS#1 v1.5 and PSS)
dghgit Sep 19, 2026
20cb229
rsa: RSASSA-PSS-SHAKE128/256 (RFC 8702 SS3.2.1)
dghgit Sep 19, 2026
6e2cb49
rsa: CLI subcommands, criterion benches, and a stack-usage harness
dghgit Sep 19, 2026
b2c505e
rsa: crate docs -- Usage Examples, Memory Usage, Security Considerations
dghgit Sep 19, 2026
d61b97c
rsa: fix test-coverage gaps found by the consolidated mutants run
dghgit Sep 19, 2026
8bf5d83
rsa: remove dead MontgomeryContext::modulus()
dghgit Sep 20, 2026
2c0166e
rsa: hand the EMSA encoders/verifiers the message hash instead of the…
dghgit Sep 20, 2026
a996164
rsa: implement bouncycastle_core's Signer/SignatureVerifier and Signa…
dghgit Sep 20, 2026
7a5407e
cli: rsa-* subcommands stream stdin through Signer/SignatureVerifier …
dghgit Sep 20, 2026
c84e7a6
rsa: drop the per-size free-function API now that every pairing is a …
dghgit Sep 21, 2026
ccaf2d7
rsa: rename the key type aliases Rsa<N>PrivateKey/Rsa<N>PublicKey to …
dghgit Sep 21, 2026
db9c026
rsa: add key pair generation (FIPS 186-5 Appendix A.1.3) for RSA-2048…
dghgit Sep 21, 2026
b539612
rsa: split the exponentiation out of rsavp1/rsasp1 into crate-private…
dghgit Sep 24, 2026
e075ea6
rsa: add RSASVE (SP 800-56B Rev. 2 §7.2.1) as a KEM for RSA-2048/3072…
dghgit Sep 24, 2026
20af567
rsa: reject a signature representative more than 64 bits shorter than…
dghgit Oct 9, 2026
eb95dce
Revert "rsa: reject a signature representative more than 64 bits shor…
dghgit Oct 10, 2026
6e98b41
rsa, cli: follow feature/ecdsa's do_ rename of the streaming Signer a…
dghgit Oct 11, 2026
c6ea90d
rsa, cli: port the signature schemes onto the key role traits
dghgit Nov 3, 2026
4ea06c8
rsa-sig: the merge-time adaptations to feature/key-rework-memory, car…
dghgit Nov 3, 2026
aa8ad7f
rsa-sig: the merge-time adaptations to release/0.1.3alpha, carried ov…
dghgit Nov 4, 2026
57c5c09
rsa: the private-key paths scrub what they derive from the primes
dghgit Nov 6, 2026
b161b6b
Merge release/0.1.4alpha 11bf46c1 (ec, ecdsa, sm2 rustdoc links) into…
dghgit Nov 7, 2026
df7d90d
Merge release/0.1.4alpha 0193cb22 (PRs #142, #141 and #140: ARIA, Cam…
dghgit Nov 7, 2026
71e0350
Merge release/0.1.4alpha c2db8107 (fix/signature-workers-dyn: the sig…
dghgit Nov 7, 2026
969265d
Merge release/0.1.4alpha f3fdb8bf (PR #192 squash: KEM encapsulation …
dghgit Nov 8, 2026
dce5490
core-test-framework: the KEM suite's fixed seed outlasts two draws of…
dghgit Nov 8, 2026
c3129a3
rsa: RSASVE moves onto the KEM key roles
dghgit Nov 8, 2026
16b6265
cli: the rsasve-* commands run through the KEM key roles, sharing mlk…
dghgit Nov 8, 2026
a660320
mem_usage_benches: the RSASVE harness calls the key roles
dghgit Nov 8, 2026
00c4b98
rsa: the crate docs name the key roles, not the Signer/SignatureVerif…
dghgit Nov 8, 2026
55c5e01
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 8, 2026
f61147f
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 10, 2026
4c3fe7f
Merge release/0.1.4alpha 7cb54e02 (PR #193 squash: two-party key agre…
dghgit Nov 11, 2026
8943048
Merge release/0.1.4alpha f87a69e1 (fix/ec-keygen squash: one key pair…
dghgit Nov 11, 2026
61fb611
Merge release/0.1.4alpha 4ce98539 (fix/ec-curve-markers squash: curve…
dghgit Nov 12, 2026
6ab8326
Merge release/0.1.4alpha f213c9e4 (fix/kdf-description-followups squa…
dghgit Nov 12, 2026
eb4aefd
Merging fix/rsa-size-markers, which writes the RSA crate once per sch…
dghgit Nov 12, 2026
010cf1a
Merging fix/rsa-scheme-keys, which makes an RSA key a key for one sch…
dghgit Nov 12, 2026
5c31875
Merging fix/rsa-pss-params, which gives RSASSA-PSS its parameters as …
dghgit Nov 13, 2026
3e57cba
Merge release/0.1.4alpha e7a46453 (the TDES squash fa7789f6, OFB edec…
dghgit Nov 16, 2026
49b2a09
Merge release/0.1.4alpha b398a3fb (the in-place finals of the #173 sw…
dghgit Nov 16, 2026
165a5d4
rsa: modexp's docs name its private helpers without linking to them
dghgit Nov 16, 2026
2a83f31
cli: do_verify's doc links to the commands that call it
dghgit Nov 16, 2026
c002bf5
Merge release/0.1.4alpha 9c220b9f (PR #186's X25519 and DHKEM, and th…
dghgit Nov 17, 2026
caecd0c
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 17, 2026
7810fb9
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 17, 2026
9360265
cli: the rsa keygen commands write the private key through the wiped …
dghgit Nov 17, 2026
e34e4e1
sha1: SHA-1 (FIPS 180-4), for interoperation with what already uses it
dghgit Nov 17, 2026
b77923f
factory: HashFactory knows SHA1 by name
dghgit Nov 17, 2026
4bddf06
cli: the sha1 command
dghgit Nov 17, 2026
09e0768
mem_usage_benches: a SHA-1 stack harness
dghgit Nov 17, 2026
bd66b93
release notes: SHA-1
dghgit Nov 17, 2026
365c2f6
core: the key-transport roles
dghgit Nov 17, 2026
6bdf390
core-test-framework: a suite for the key-transport roles
dghgit Nov 17, 2026
738ee9b
rsa: RSAES-OAEP key transport (RFC 8017 Section 7.1; SP 800-56B Rev. …
dghgit Nov 17, 2026
b97f976
cli: the rsasve commands write their private key and shared secret th…
dghgit Nov 17, 2026
e68465e
cli: the rsa-oaep-<size> commands
dghgit Nov 17, 2026
e534f90
mem_usage_benches: OAEP encapsulation and decapsulation in the RSA st…
dghgit Nov 17, 2026
6e6f9f8
release notes: RSAES-OAEP
dghgit Nov 17, 2026
ee71323
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 17, 2026
1de17cd
rsa: RSAES-OAEP review fixes
dghgit Nov 17, 2026
6d6f6f6
cli: the rsa-oaep commands bound their hashes on OaepHash
dghgit Nov 17, 2026
7661f53
core-test-framework: wycheproof() falls back to the copies in bc-test…
dghgit Nov 17, 2026
a1d124e
dev_scripts: a constant-time check of the EME-OAEP decoding, run on p…
dghgit Nov 17, 2026
fde5703
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 17, 2026
8944bc2
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 18, 2026
a6331b3
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 18, 2026
934d4c5
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 18, 2026
8b8f62c
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 19, 2026
c19ce45
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 19, 2026
79bd7b0
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 19, 2026
b7e46cb
rsa: the RSA keys implement the one-shot signature roles
dghgit Nov 19, 2026
267ef51
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 20, 2026
276af11
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 20, 2026
e1186b9
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 20, 2026
b09c359
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 20, 2026
6a461c0
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 21, 2026
c71fa76
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 21, 2026
473db44
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 21, 2026
ce17554
sha1: SHA-1 is not a CollisionResistantHash, and the docs say what fo…
dghgit Nov 21, 2026
e061cd6
rsa: signing requires a CollisionResistantHash
dghgit Nov 21, 2026
0cdcb6b
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 21, 2026
04305e0
rsa: the Montgomery setup over p and q is constant time
dghgit Nov 22, 2026
e395060
rsa: a signature key requires a full-length modulus
dghgit Nov 22, 2026
f3275fb
rsa: a short draw from the RNG is an error
dghgit Nov 22, 2026
4d83a76
rsa: the public exponentiation runs over the exponent's bits
dghgit Nov 22, 2026
d23a1ab
cli: the rsa-oaep commands take their key lengths from the size markers
dghgit Nov 22, 2026
6c58545
rsa: the public exponent is a u64
dghgit Nov 22, 2026
3f27178
rsa: the private key carries e, and the CRT result is checked before …
dghgit Nov 22, 2026
9093265
cli: the RSA commands and their tests follow the new key encodings
dghgit Nov 22, 2026
34f9ec8
rsa: the context over a secret modulus does not test its parity
dghgit Nov 22, 2026
a2a8f0c
rsa: the from_hash entry points check the hash and salt lengths
dghgit Nov 22, 2026
357abdb
rsa: nothing is encapsulated or transported toward RSA-1024 or RSA-1536
dghgit Nov 22, 2026
2e53d0b
rsa: four doc comments say what the code and the specifications say
dghgit Nov 22, 2026
c08e057
rsa: inconsistent width parameters are a compile-time error
dghgit Nov 22, 2026
6bba5cc
ec: the Montgomery and Barrett width parameters are checked at compil…
dghgit Nov 22, 2026
91345de
mem_usage_benches: the RSA harness prints the new key sizes, and the …
dghgit Nov 22, 2026
f94067c
sha1: the crate is no_std
dghgit Nov 22, 2026
2c0ef07
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 22, 2026
5ea0934
rsa: private-key operations and key handling wipe the stack they used
dghgit Nov 22, 2026
7e4899a
core-test-framework: the streaming signature suites take an algorithm…
dghgit Nov 22, 2026
2c4fbc1
rsa: a non-empty context is refused, not dropped
dghgit Nov 22, 2026
40ac602
cli: the rsa commands' note on ctx says a context is refused
dghgit Nov 22, 2026
5f35d69
rsa: EMSA-PSS refuses a modulus too short for its hash and salt
dghgit Nov 22, 2026
2d21597
rsa: encapsulation with HKDF wipes the stack it used
dghgit Nov 22, 2026
3782ae3
rsa: the public primality test wipes the stack it used
dghgit Nov 22, 2026
41f686e
rsa: the docs say that taking a key out of its Result is a move
dghgit Nov 22, 2026
628980a
release notes: one entry for RSA, stating what the crate does
dghgit Nov 22, 2026
ec7a342
rsa: rsa_core's docs say which exponentiations are public, and public…
dghgit Nov 22, 2026
115d52e
mem_usage_benches: the RSA encapsulation functions build their public…
dghgit Nov 22, 2026
aa43e45
mem_usage_benches: the RSA key and signature lengths are printed from…
dghgit Nov 22, 2026
0c68586
rsa: the RSA-8192 tests run Wycheproof's verification files in full
dghgit Nov 22, 2026
4acec9e
rsa: the Security Considerations headings take the form QUALITY_AND_S…
dghgit Nov 22, 2026
a34ad6d
core: SignatureError::ComputationFault's docs allow for a key whose p…
dghgit Nov 22, 2026
16a446c
core-test-framework: CtxBehaviour::Ignored's docs no longer name RSA
dghgit Nov 22, 2026
16c938e
rsa: OaepParams's compile_fail doctest names its error
dghgit Nov 22, 2026
bde7a4f
rsa: references to the Encoding sections name the types that carry them
dghgit Nov 22, 2026
fc6dfa8
cli: the rsa commands' references to the Encoding docs name the compo…
dghgit Nov 22, 2026
5658657
dev_scripts: a memcheck of the RSA private-key arithmetic with the ke…
dghgit Nov 22, 2026
5490741
dev_scripts: a search of the stack each RSA private-key operation used
dghgit Nov 22, 2026
8447c5b
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 22, 2026
ad80432
CLAUDE.md: the two RSA developer checks, and that CI does not run them
dghgit Nov 22, 2026
f549c5a
ci: a workflow runs the two RSA checks
dghgit Nov 22, 2026
80d8651
rsa: the PSS length check is tested at its boundary
dghgit Nov 22, 2026
5adea44
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 22, 2026
a1664c9
cli: drop the RSA private key before exiting on a signing failure
dghgit Nov 22, 2026
904990e
rsa: docs say the bytes encode returns and the key clone returns are …
dghgit Nov 22, 2026
70b2484
dev_scripts: drop cli_ccm_cfb_examples.sh, which is not part of this …
dghgit Nov 22, 2026
ddad4fd
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 22, 2026
d300f4d
digest: sha1 becomes a module of bouncycastle-digest
dghgit Nov 22, 2026
b695f6c
umbrella: drop the bouncycastle::sha1 alias; SHA-1 is bouncycastle::d…
dghgit Nov 22, 2026
98f284a
ci: the no-std step tests digest's unit tests and scrypt's caller-mem…
dghgit Nov 22, 2026
e8a4335
Merge branch 'release/0.1.4alpha' into feature/rsa-sig
dghgit Nov 22, 2026
30cbbab
rsa, digest: bouncycastle_hex is bouncycastle_core::hex
dghgit Nov 22, 2026
3b7c509
rsa: 25 Miller-Rabin rounds, the CRT congruences checked at import, k…
dghgit Nov 23, 2026
e7511c7
rsa: a key-establishment private key validates as its components do
dghgit Nov 23, 2026
0a6972d
rsa, cli, ci: the pre-merge review's findings
dghgit Nov 23, 2026
2c50a01
rsa: the private-key exponentiation is not public API
dghgit Nov 23, 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 .gitea/workflows/rust-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@ jobs:
# --all-features above never builds a crate with a default feature off. scrypt without
# `std` is its caller-supplied-memory configuration, and it once did not compile.
- name: Test bouncycastle-digest without std
run: cargo test -p bouncycastle-digest --no-default-features
# The vector suites need bc-test-data, which this job does not check out.
# Every target is built first, so that one that stops compiling without std is seen.
run: |
cargo test -p bouncycastle-digest --no-default-features --no-run
cargo test -p bouncycastle-digest --no-default-features --lib --test scrypt_scrypt_caller_memory_tests
29 changes: 29 additions & 0 deletions .github/workflows/oaep-ct.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: OAEP Constant-Time Decode

on:
pull_request:

permissions:
contents: read

concurrency:
group: oaep-ct-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
oaep-ct:
if: github.repository == 'bcgit/bc-rust'
name: oaep-ct
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install valgrind
run: sudo apt-get update && sudo apt-get install -y valgrind

- name: Install nightly with rust-src
run: rustup toolchain install nightly --profile minimal --component rust-src

- name: Check the EME-OAEP decode under memcheck and in the Cortex-M0 and RISC-V 32I assembly
run: ./dev_scripts/check_oaep_ct.sh
29 changes: 29 additions & 0 deletions .github/workflows/rsa-ct-stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: RSA Constant-Time Setup and Stack Wipes

on:
pull_request:

permissions:
contents: read

concurrency:
group: rsa-ct-stack-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
rsa-ct-stack:
if: github.repository == 'bcgit/bc-rust'
name: rsa-ct-stack
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install valgrind
run: sudo apt-get update && sudo apt-get install -y valgrind

- name: Check the RSA private-key arithmetic under memcheck with the key undefined
run: ./dev_scripts/check_rsa_ct.sh

- name: Search the stack each RSA private-key operation used for the key
run: ./dev_scripts/check_rsa_stack.sh
6 changes: 5 additions & 1 deletion .github/workflows/rust-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ jobs:
# --all-features above never builds a crate with a default feature off. scrypt without
# `std` is its caller-supplied-memory configuration, and it once did not compile.
- name: Test bouncycastle-digest without std
run: cargo test -p bouncycastle-digest --no-default-features
# The vector suites need bc-test-data, which this job does not check out.
# Every target is built first, so that one that stops compiling without std is seen.
run: |
cargo test -p bouncycastle-digest --no-default-features --no-run
cargo test -p bouncycastle-digest --no-default-features --lib --test scrypt_scrypt_caller_memory_tests
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ custom_mutants_output/
.claude/settings.local.json
.claude 2/
dev_scripts/aes_ct_harness/Cargo.lock
dev_scripts/oaep_ct_harness/Cargo.lock
dev_scripts/rsa_ct_harness/Cargo.lock
dev_scripts/rsa_stack_harness/Cargo.lock
27 changes: 20 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Revisit this section at the first non-alpha release.

- Builds on Rust **stable**: there is no toolchain pin, and no crate enables a `#![feature(...)]` gate, so
nightly-only tooling (`-Z` flags and the like) is not available. CI builds, tests and docs on stable; only the
`rustfmt` job and the AES assembly check (`-Zbuild-std=core` for targets without a shipped `core`) install
`rustfmt` job and the AES and OAEP assembly checks (`-Zbuild-std=core` for targets without a shipped `core`) install
nightly.
- 2024 edition (set workspace-wide in the root `Cargo.toml`).
- Minimum Rust is 1.88: `rust-version` in the root `Cargo.toml`, inherited by `bouncycastle-utils` (the crate that
Expand Down Expand Up @@ -127,7 +127,7 @@ crypto/<name>/

A family crate holds its primitives as modules, each with the layout it had as a crate:
`bouncycastle-hybrid` (`crypto/hybrid`: `hpke`), `bouncycastle-digest` (`crypto/digest`: `blake2`,
`concatkdf`, `pbkdf2`, `ripemd`, `scrypt`, `sm3`, `x963kdf`), `bouncycastle-symmetric`
`blake3`, `concatkdf`, `pbkdf2`, `ripemd`, `scrypt`, `sha1`, `sm3`, `x963kdf`), `bouncycastle-symmetric`
(`crypto/symmetric`: `aria`, `ascon`, `camellia`, `chacha20`, `chacha20_poly1305_aead`, `kbkdf`,
`poly1305`, `sm4`, `tdes`) and `bouncycastle-pqc` (`crypto/pqc`: `mldsa`,
`mldsa_lowmemory`, `mlkem`, `mlkem_lowmemory`, and the `mldsa_common` / `mlkem_common` modules the
Expand Down Expand Up @@ -468,11 +468,12 @@ external vector suites — is specified in QUALITY_AND_STYLE.md and CONTRIBUTING

## CI

Six workflows under `.github/workflows/`, all triggered by pull requests:
Eight workflows under `.github/workflows/`, all triggered by pull requests:

- `rust-build.yml`: `cargo build --workspace --all-targets --all-features` on stable, then
`cargo test -p bouncycastle-digest --no-default-features`, since `--all-features` never
builds a crate with a default feature off.
`cargo test -p bouncycastle-digest --no-default-features` on the crate's unit tests and scrypt's
caller-memory tests (the vector suites need bc-test-data, which that job does not check out),
since `--all-features` never builds a crate with a default feature off.
- `rust-test.yml`: `cargo test --all` on stable, with `bcgit/bc-test-data` and `C2SP/wycheproof`
checked out beside the repository. Wycheproof is pinned to a commit (`ref:` in the workflow), so
that a change upstream does not fail an unrelated PR: a vector suite that is strict about the
Expand All @@ -483,6 +484,18 @@ Six workflows under `.github/workflows/`, all triggered by pull requests:
- `aes-ct-asm.yml`: `dev_scripts/check_aes_ct_asm.sh` on **nightly** with `rust-src`: builds
`dev_scripts/aes_ct_harness` for thumbv6m and riscv32i and greps the assembly of the AES round-key
widening for a multiply, call or branch (see the comment on `PlaneWord::splat` in the aes crate).
- `oaep-ct.yml`: `dev_scripts/check_oaep_ct.sh` with valgrind and **nightly** `rust-src`: runs
`dev_scripts/oaep_ct_harness` (the EME-OAEP decode, included by path) under memcheck with the encoded
message undefined, with a variable-time control, and greps its thumbv6m and riscv32i assembly for a
multiply, divide or unexpected call.
- `rsa-ct-stack.yml`: two checks of `crypto/rsa`, on the runner's stable toolchain. `dev_scripts/check_rsa_ct.sh`
with valgrind runs `dev_scripts/rsa_ct_harness` (the Montgomery setup over a secret modulus, the checked
CRT and a key constructor's congruences; the last two through the crate's `ct_harness` module, which exists
only under `--cfg bouncycastle_rsa_ct_harness`) under memcheck with the key undefined, with controls that must
be reported. `dev_scripts/check_rsa_stack.sh` runs `dev_scripts/rsa_stack_harness`, which paints the stack, runs
each private-key operation and searches what it used for the key and what was derived from it. The second is
sized by measurement for an x86-64 release build, so a new compiler that lays frames out deeper fails it: that
is the check working, and the fix is to re-measure the wipe sizes, not to drop the step.
- `publish_doc_benches_to_ghpages.yaml`: builds rustdoc and runs `quality_stats.sh`; on `main` it also
publishes docs and code stats to GitHub Pages (`https://bcgit.github.io/bc-rust/`). Its bench step is
commented out because the benches are too slow on the hosted runner, so benchmark figures come from a
Expand All @@ -491,8 +504,8 @@ Six workflows under `.github/workflows/`, all triggered by pull requests:
`cargo test --all` is the workspace run, so a failing test does block a PR; what CI does not run is
`cargo mutants`, the CLI shell tests under `cli/tests/`, or rustdoc with warnings denied.

The gitea origin has its own copies of the five pull-request checks under `.gitea/workflows/`
(there is no Pages job). They differ from the GitHub ones in two ways: the toolchain is installed
The gitea origin has its own copies of five of the pull-request checks under `.gitea/workflows/`
(there is no Pages job, and `oaep-ct.yml` and `rsa-ct-stack.yml` have no gitea copy). They differ from the GitHub ones in two ways: the toolchain is installed
with `rustup` in a shell step, and the test job takes its vectors from the runner's read-only
`/bc-test-data` and `/wycheproof` mounts, failing if either is missing. Wycheproof's are read out
of the mounted clone at the pinned commit (`git archive`), wherever the clone's `HEAD` is, so the
Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ bouncycastle-dhkem = { path = "./crypto/dhkem" }
bouncycastle-hybrid = { path = "./crypto/hybrid" }
bouncycastle-pqc = { path = "./crypto/pqc" }
bouncycastle-rng = { path = "./crypto/rng" }
bouncycastle-rsa = { path = "./crypto/rsa" }
bouncycastle-sha2 = { path = "./crypto/sha2" }
bouncycastle-sha3 = { path = "./crypto/sha3" }
bouncycastle-sm2 = { path = "./crypto/sm2" }
Expand Down Expand Up @@ -73,6 +74,7 @@ bouncycastle-dhkem.workspace = true
bouncycastle-hybrid.workspace = true
bouncycastle-pqc.workspace = true
bouncycastle-rng.workspace = true
bouncycastle-rsa.workspace = true
bouncycastle-sha2.workspace = true
bouncycastle-sha3.workspace = true
bouncycastle-sm2.workspace = true
26 changes: 26 additions & 0 deletions alpha_0.1.4_release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,32 @@
`kbkdf-double-pipeline`, `kbkdf-kmac128` and `kbkdf-kmac256` CLI commands.
* `bouncycastle-dhkem` -- the generic DHKEM is a crate of its own, apart from HPKE, and gains `AuthEncap` and
`AuthDecap`. Its `_out` functions return the number of bytes written.
* SHA-1 -- `bouncycastle_digest::sha1`, FIPS 180-4's SHA-1 on the `Hash` traits, for interoperation with what already
uses it (an older peer's RSA-OAEP hash or MGF1, a fingerprint): not collision resistant, so it is credited with
no security strength (`SecurityStrength::None`). Checked against NIST's CAVP SHAVS vectors and RFC 3174's; the
`sha1` CLI command. It does not carry `CollisionResistantHash`, so the RSA signature schemes verify over it and
do not sign, short of `hazmat::WithoutCollisionResistance<SHA1>`.
* RSA -- `bouncycastle-rsa`: RSASSA-PKCS1-v1_5 and RSASSA-PSS (RFC 8017 Section 8) on the signature roles, RSASVE
(NIST SP 800-56B Rev. 2 Section 7.2.1) on the KEM roles, its secret value raw or through HKDF, and key generation
by FIPS 186-5 Appendix A.1.3 with 25 Miller-Rabin rounds (FIPS 140-3 IG C.F), at RSA-2048, 3072, 4096 and 8192;
RSA-1024 and RSA-1536 verify signatures and nothing else. A public key encodes as `n || e` and a private key as
`p || q || dP || dQ || qInv || e`, with `e` in 8 big-endian bytes, and a modulus must have exactly its size's bit
length. A private key's constructor and decoder refuse components that do not belong together with `e` (RFC 8017
Section 3.2), in constant time; `RsaPrivateComponents::validate` is SP 800-56B Rev. 2 Section 6.4.1.4.3's
validation of a key pair, primality included, for a key from elsewhere. The result of every private-key
operation is checked against `e` before it is released (`SignatureError::ComputationFault`, or the operation's
one decryption error). A non-empty `ctx` is refused with `SignatureError::LengthError`, RSA having no context
input. Private-key operations wipe the stack they used, sized for an optimised x86-64 build; a key the caller
moves out of the `Result` it was returned in is the caller's to wipe. The `rsa-<size>` and `rsasve-<size>` CLI
commands. Two checks, run by CI and by hand: `dev_scripts/check_rsa_ct.sh` puts the CRT and the constructor's
congruences under memcheck with the key undefined, and `dev_scripts/check_rsa_stack.sh` searches the stack each
private-key operation used for the key.
* RSAES-OAEP -- RFC 8017 Section 7.1 key transport on the RSA key-establishment keys, under `OaepParams<H, M, LEN>`
(label hash, MGF1 hash, label): as a KEM that draws the key (KTS-OAEP-basic, SP 800-56B Rev. 2) and, through
the new `core::key_transport_key` roles, for a key the caller holds; the `rsa-oaep-<size>` CLI commands. The hashes
are RFC 8017's seven (SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256), a sealed trait
`OaepHash`. `dev_scripts/check_oaep_ct.sh`, run on pull requests, puts the decoding under memcheck with the encoded
message undefined and reads its Cortex-M0 and RISC-V 32I assembly.

## Minor features / bug fixes

Expand Down
Loading
Loading