Commit Graph

1118 Commits

Author SHA1 Message Date
Tony Arcieri b2bffe5fc7 ml-dsa: initial Wycheproof test vectors (#1175)
Uses a similar strategy to `rsa`, cloning the Wycheproof test vectors as
a submodule and parsing the JSON files directly (I tried to use
`wycheproof2blb` and it seems really out of date).

Adds the following as an initial integration:
- `mldsa_44_sign_seed_test`
- `mldsa_65_sign_seed_test`
- `mldsa_87_sign_seed_test`
2026-01-25 16:41:24 -07:00
Tony Arcieri 3f69e4e2ad dsa v0.7.0-rc.11 (#1174) dsa/v0.7.0-rc.11 2026-01-25 13:38:33 -07:00
Tony Arcieri e22c4fc5a2 dsa: bump dependencies (#1173)
Upgrades the following dependency requirements:
- `digest` v0.11.0-rc.8
- `crypto-bigint` v0.7.0-rc.22
- `crypto-primes` v0.7.0-pre.8
- `getrandom` v0.4.0-rc.1
- `pkcs8` v0.11.0-rc.10
- `sha2` v0.11.0-rc.4
- `signature` v3.0.0-rc.9
2026-01-25 13:01:53 -07:00
Tony Arcieri 11d23fd07c Cargo.toml: update crypto-primes patch (#1172) 2026-01-24 19:02:39 -07:00
Tony Arcieri 17411848ca ecdsa v0.17.0-rc.14 (#1171) ecdsa/v0.17.0-rc.14 2026-01-24 15:41:24 -07:00
Tony Arcieri 66295315cf Bump rand_core to v0.10.0-rc-6 (#1170)
Renames `(Try)RngCore` => `(Try)Rng`
2026-01-24 15:30:36 -07:00
Tony Arcieri ec88a73c79 dsa v0.7.0-rc.10 (#1168) dsa-v0.7.0-rc.10 2026-01-21 12:49:06 -07:00
Tony Arcieri 13ca313f8d Cargo.lock: bump dependencies (#1167)
Updates the following dependencies:

    $ cargo update
    Updating crates.io index
     Locking 33 packages to latest compatible versions
    Updating aho-corasick v1.1.3 -> v1.1.4
    Updating base64ct v1.8.0 -> v1.8.3
    Updating bumpalo v3.19.0 -> v3.19.1
    Updating clap v4.5.50 -> v4.5.54
    Updating clap_builder v4.5.50 -> v4.5.54
    Updating clap_lex v0.7.6 -> v0.7.7
    Updating cmov v0.5.1 -> v0.5.2
    Updating const-oid v0.10.1 -> v0.10.2
    Updating hex-literal v1.0.0 -> v1.1.0
    Updating itoa v1.0.15 -> v1.0.17
    Updating js-sys v0.3.81 -> v0.3.85
    Removing lazy_static v1.5.0
    Updating libc v0.2.177 -> v0.2.180
    Removing log v0.4.28
    Updating pkcs8 v0.11.0-rc.8 -> v0.11.0-rc.9
    Updating proc-macro2 v1.0.101 -> v1.0.105
    Updating proptest v1.8.0 -> v1.9.0
    Updating quote v1.0.41 -> v1.0.43
    Updating rand_core v0.9.3 -> v0.9.5
    Updating rustix v1.1.2 -> v1.1.3
    Removing ryu v1.0.20
    Updating serde_json v1.0.145 -> v1.0.149
    Updating sha1 v0.11.0-rc.2 -> v0.11.0-rc.3
    Updating syn v2.0.107 -> v2.0.114
    Updating tempfile v3.23.0 -> v3.24.0
    Updating unicode-ident v1.0.20 -> v1.0.22
    Updating wasip2 v1.0.1+wasi-0.2.4 -> v1.0.2+wasi-0.2.9
    Updating wasm-bindgen v0.2.104 -> v0.2.108
    Removing wasm-bindgen-backend v0.2.104
    Updating wasm-bindgen-macro v0.2.104 -> v0.2.108
    Updating wasm-bindgen-macro-support v0.2.104 -> v0.2.108
    Updating wasm-bindgen-shared v0.2.104 -> v0.2.108
    Updating web-sys v0.3.81 -> v0.3.85
    Updating wit-bindgen v0.46.0 -> v0.51.0
    Updating zerocopy v0.8.27 -> v0.8.33
    Updating zerocopy-derive v0.8.27 -> v0.8.33
      Adding zmij v1.0.16
2026-01-21 11:54:43 -07:00
Arthur Gautier 3edd7d6dbf chore(deps): bump crypto-primes to 0.7.0-pre.7 (#1165)
Remove `patch.crates-io` on non-main branches.
2026-01-20 17:18:46 -07:00
Tony Arcieri 015bd72e5b ecdsa v0.17.0-rc.13 (#1164) ecdsa/v0.17.0-rc.13 2026-01-20 12:42:36 -07:00
Tony Arcieri c13a0d808f Upgrade dependencies (#1163)
- `digest` v0.11.0-rc.7
- `elliptic-curve` v0.14.0-rc.23
- `signature` v3.0.0-rc.8
2026-01-20 12:14:02 -07:00
Arthur Gautier 4b8dee598e chore(deps): bump rand_core to 0.10.0-rc-5 (#1161) 2026-01-20 11:29:27 -07:00
dependabot[bot] 187bcbe4e3 build(deps): bump cmov from 0.4.3 to 0.4.5 (#1150) 2026-01-15 12:00:40 -07:00
Tony Arcieri 74e20a93fa dsa v0.7.0-rc.9 (#1149) dsa/v0.7.0-rc.9 2026-01-12 14:40:12 -07:00
Tony Arcieri 837975e56c dsa: bump crypto-bigint to v0.7.0-rc.16 (#1148)
Includes changes to the `BoxedMontyForm::new` API, and also bumps
`crypto-primes` to v0.7.0-rc.6 which includes the associated updates
to that crate for the API change.
2026-01-12 13:34:07 -07:00
dependabot[bot] 1633795f9a build(deps): bump crate-ci/typos from 1.41.0 to 1.42.0 (#1147) 2026-01-12 11:28:10 -07:00
Tony Arcieri 4f0ee3c0c3 ml-dsa v0.1.0-rc.3 (#1146) ml-dsa/v0.1.0-rc.3 2026-01-10 14:42:32 -07:00
Charles Edward Gagnon db04f38935 ed25519: optional zerocopy dependency (#1134)
Derives trait impls for `Signature` and `PublicKeyBytes`
2026-01-10 14:15:32 -07:00
Tony Arcieri 3138dd20e3 ml-dsa: rename and deprecate ExpandedSigningKey (#1145)
Renames `EncodedSigningKey` to `ExpandedSigningKey` to contrast it with
seeds, the preferred API. Also renames the `decode` and `encode`
functions to `from_expanded` and `to_expanded`, similar to the changes
made to `ml-kem`'s `DecapsulationKey` in RustCrypto/KEMs#163,
which also deprecated these APIs.

We don't properly implement validation of such keys which can lead to
panics in the event they were improperly or maliciously generated
(#1133), a problem avoided by using seeds. For now, this merely
documents the panic condition.

Most implementers have opted not to provide support for this key format
due to these problems (it's also actually more expensive to validate an
expanded key than it is to use a seed), and also where seeds are the
same size regardless of security level, the expanded keys vary in size.
2026-01-10 14:09:23 -07:00
Scott Arciszewski 035d9eef98 ml-dsa: use Barrett reduction instead of integer division to prevent side-channels (#1144) 2026-01-09 12:06:07 -07:00
Tony Arcieri 73474a9ba0 ecdsa v0.17.0-rc.12 (#1143) ecdsa/v0.17.0-rc.12 2026-01-08 09:56:16 -07:00
Tony Arcieri 47379ade8c ecdsa: add bench_ecdsa! macro (#1142)
Adds a macro for writing `criterion` benchmarks for ECDSA signing and
verification, similar to other benchmark macros recently added to
`elliptic-curve` and `primeorder`.

The macro should be compatible with both `criterion` v0.7 and v0.8,
allowing for downstream users to ship with MSRV 1.85 support then
upgrade later without requiring breaking changes to this macro.
2026-01-07 14:02:42 -07:00
dependabot[bot] 85a0930103 build(deps): bump crate-ci/typos from 1.40.0 to 1.41.0 (#1138) 2026-01-07 13:29:27 -07:00
Tony Arcieri 44e6f942fd ecdsa: dev module fixups (#1141)
- Pull in `MockCurve` from `elliptic_curve::dev::mock_curve`
- Move macros to top of file
2026-01-07 13:07:50 -07:00
Tony Arcieri d669c66b4a ecdsa: use the crypto_common::Generate trait (#1140)
Updates that go along with RustCrypto/traits#2173, which switched the
`elliptic-curve` to use the `Generate` trait introduced in
RustCrypto/traits#2096
2026-01-06 11:23:15 -07:00
Steven Dee 4112075105 dsa: decouple precise RNG state from tests (#1139)
The `signature` test was too tightly coupled with the precise RNG
output, in effect not just testing the DSA signature/verification logic
but also testing that the exact bit sequence was produced by the
dependent crate.

We already have tests against deterministic keys and signatures at
`tests/deterministic.rs`, so modify `tests/signature.rs` to instead
generate a random keypair using the system RNG, then generate a
signature with that keypair, and then verify that signature.

The existing hard-coded signatures have been left in place as they are
used to test PKCS decoding and encoding.
2026-01-05 17:33:18 -07:00
Tony Arcieri ab591d8a12 ecdsa: bump elliptic-curve to v0.14.0-rc.20 (#1137) 2026-01-04 21:37:15 -07:00
Tony Arcieri a1e2bce0f0 slh-dsa v0.2.0-rc.2 (#1135) slh-dsa/v0.2.0-rc.2 2026-01-04 18:58:17 -07:00
Tony Arcieri 678f46d2d1 slh-dsa: bump rand to v0.10.0-rc.6 (#1132)
Gets rid of the `git` crate dependency
2026-01-04 08:16:41 -07:00
Tony Arcieri 9c6961e00c ecdsa v0.17.0-rc.11 (#1131) ecdsa/v0.17.0-rc.11 2026-01-03 22:17:11 -07:00
Tony Arcieri efc4e27122 ecdsa: bump elliptic-curve to v0.14.0-rc.19 (#1130) 2026-01-03 22:08:29 -07:00
Tony Arcieri 223d52886b dsa v0.7.0-rc.8 (#1129) dsa/v0.7.0-rc.8 2026-01-03 14:23:02 -07:00
Tony Arcieri 05b77d63b1 dsa: bump crypto-primes to v0.7.0-pre.5 (#1128) 2026-01-03 13:19:08 -07:00
Tony Arcieri 48b7f61e52 RNG cleanup (#1127)
Switches every crate except `slh-dsa` away from a direct `rand`
dependency they don't need. Right now we can't publish any crate that
directly depends on `rand`.

Uses a consistent default strategy for RNGs: `SysRng`, sourced from the
`getrandom` or as `rand::rngs::SysRng` in the case of `slh-dsa` which is
actually using `rand`-specific features.

If this causes too much of a slowdown, we can re-evaluate and go (back)
to `ChaCha8Rng` where needed for testing.
2025-12-29 21:07:55 -07:00
Tony Arcieri f38b8aacd4 ecdsa v0.17.0-rc.10 (#1126) ecdsa/v0.17.0-rc.10 2025-12-29 17:56:24 -07:00
Tony Arcieri 5c313bc249 ecdsa: bump elliptic-curve to v0.14.0-rc.18 (#1125) 2025-12-29 17:29:08 -07:00
dependabot[bot] b2be6f5c56 build(deps): bump actions/checkout from 5 to 6 (#1113) 2025-12-29 10:10:31 -07:00
dependabot[bot] de9aabc14b build(deps): bump crate-ci/typos from 1.39.0 to 1.40.0 (#1114) 2025-12-29 09:45:21 -07:00
Tony Arcieri 81149cc5ae Bump crypto-bigint to v0.7.0-rc.12 (#1124)
This includes a migration from `subtle` to `ctutils`
2025-12-29 09:45:05 -07:00
Tony Arcieri 6caa0f27cd Use getrandom v0.4.0-rc.0 crate release (#1123) 2025-12-28 08:39:26 -07:00
Nics 0a580ede41 slh-dsa: SHA-2: PK.Seed state caching (#1116)
This PR is meant to address issue #1035.

It introduces an optimisation mentioned in section 8.1.6. of SPHINCS+
specification: caching the intermediate state during SHA-2 computations.

On my laptop, I observe an improvement in signing/verification time in the range
of ~15-25% (using the criterion benchmark provided).
2025-12-27 19:29:18 -07:00
Tony Arcieri a8df31793c Bump signature dependency to v3.0.0-rc.6 (#1122)
Also bumps the `digest` crate dependency to v0.11.0-rc.5 and `rand_core`
to v0.10.0-rc-3
2025-12-27 16:15:23 -07:00
Tony Arcieri 5080928121 CI: fix security audit (#1121) 2025-12-24 13:01:31 -07:00
Tony Arcieri e6adddcdd3 ed25519+ed448: remove bincode dev-dependency (#1120)
`bincode` is unmaintained. See https://crates.io/crates/bincode/3.0.0
2025-12-18 10:27:18 -07:00
dependabot[bot] a155ad8acc build(deps): bump actions/cache from 4 to 5 (#1118) 2025-12-16 06:31:18 -07:00
dependabot[bot] 936f221980 build(deps): bump actions/download-artifact from 6 to 7 (#1117) 2025-12-16 06:30:56 -07:00
dependabot[bot] 9c0936f04a build(deps): bump actions/upload-artifact from 5 to 6 (#1119) 2025-12-16 06:30:40 -07:00
Tony Arcieri 87dc8f51ca ml-dsa: remove references to ML-KEM (#1112)
These are leftover from adapting code from the `ml-kem` crate
2025-11-21 18:58:02 -07:00
Tony Arcieri d56f99f13f ecdsa v0.17.0-rc.9 (#1111) ecdsa/v0.17.0-rc.9 2025-11-21 18:53:12 -07:00
dependabot[bot] 1ec7047fb2 build(deps): bump actions/upload-artifact from 4 to 5 (#1090) 2025-11-21 18:43:53 -07:00