Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 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
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
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ custom_mutants_output/
.claude/settings.local.json
.claude 2/
dev_scripts/aes_ct_harness/Cargo.lock
dev_scripts/oaep_ct_harness/Cargo.lock
8 changes: 6 additions & 2 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 @@ -437,7 +437,7 @@ external vector suites — is specified in QUALITY_AND_STYLE.md and CONTRIBUTING

## CI

Six workflows under `.github/workflows/`, all triggered by pull requests:
Seven 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-scrypt --no-default-features`, since `--all-features` never
Expand All @@ -448,6 +448,10 @@ 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.
- `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 Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ bouncycastle-mldsa-lowmemory = { path = "./crypto/mldsa-lowmemory" }
bouncycastle-poly1305 = { path = "./crypto/poly1305" }
bouncycastle-ripemd = { path = "./crypto/ripemd" }
bouncycastle-rng = { path = "./crypto/rng" }
bouncycastle-rsa = { path = "./crypto/rsa" }
bouncycastle-sha1 = { path = "./crypto/sha1" }
bouncycastle-sha2 = { path = "./crypto/sha2" }
bouncycastle-sha3 = { path = "./crypto/sha3" }
bouncycastle-sm2 = { path = "./crypto/sm2" }
Expand Down Expand Up @@ -113,6 +115,8 @@ bouncycastle-mlkem-lowmemory.workspace = true
bouncycastle-poly1305.workspace = true
bouncycastle-ripemd.workspace = true
bouncycastle-rng.workspace = true
bouncycastle-rsa.workspace = true
bouncycastle-sha1.workspace = true
bouncycastle-sha2.workspace = true
bouncycastle-sha3.workspace = true
bouncycastle-sm2.workspace = true
Expand Down
10 changes: 10 additions & 0 deletions alpha_0.1.4_release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@
* `bouncycastle-dhkem` -- the generic DHKEM leaves `bouncycastle-hpke` for a crate of its own
(`bouncycastle_hpke::dhkem::*` is now `bouncycastle_dhkem::*`), and gains `AuthEncap` and `AuthDecap`. Its
`_out` functions return the number of bytes written.
* SHA-1 -- `bouncycastle-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`) and is reached only by name; `HashFactory` "SHA1" and the
`sha1` CLI command. Checked against NIST's CAVP SHAVS vectors and RFC 3174's.
* 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