Commit Graph

1258 Commits

Author SHA1 Message Date
dependabot[bot] 63a79f3822 build(deps): bump elliptic-curve from 0.14.0-rc.32 to 0.14.0-rc.33 (#1368) 2026-06-04 09:06:09 -06:00
Tony Arcieri 275aea5146 dsa: add TryCryptoRng support (#1367)
This renames the previous `generate` methods to
`try_generate_from_rng_with_key_size` and changes them to accept a
`TryCryptoRng`, returning a `Result` with potential RNG errors.

This helps clear the way for implementing the `Generate` trait from
`crypto-common`, which defines its own `generate` method which takes
no parameters, using the system RNG and default key size.
2026-06-02 15:20:32 -06:00
Kingsley Yung c97a63150d ml-dsa: alloc feature implies module-lattice/alloc (#1365)
Enable `module-lattice/alloc` feature when the `alloc` feature is
enabled. With this change, users don't need to add an explicit entry
`module-lattice` at `Cargo.toml` to enable the `alloc` feature of the
`module-lattice` crate.

This also aligns with the behavior of the `ml-kem` crate.
2026-06-02 07:33:00 -06:00
Tony Arcieri 699547f9c3 ml-dsa v0.1.0 (#1356) ml-dsa/v0.1.0 2026-05-17 09:37:36 -06:00
Tony Arcieri 4055f370fd ml-dsa: migrate from sha3 to shake (#1355)
See: RustCrypto/hashes#869
2026-05-16 12:28:18 -06:00
dependabot[bot] 3166358438 build(deps): bump hybrid-array from 0.4.11 to 0.4.12 (#1353) 2026-05-11 17:27:22 -06:00
Tony Arcieri ad600420a1 rfc6979: migrate from subtle to ctutils (#1352)
The usage is an internal implementation detail, so this is not a
breaking change.

See also: RustCrypto/meta#29
2026-05-10 16:43:34 -06:00
Tony Arcieri 3b596f42eb README.md: fix xmss badges 2026-05-10 15:54:54 -06:00
Tony Arcieri 59fea640a4 ml-dsa v0.1.0-rc.11 (#1351)
This should be a true "release candidate" in that there are no
additional changes intended to be made before a final release, we're
just waiting for some final feedback on recent changes.
ml-dsa/v0.1.0-rc.11
2026-05-10 15:53:13 -06:00
Tony Arcieri 093267c91d ml-dsa: use MaybeBox from module-lattice crate (#1350)
The `MaybeBox` type was moved to `module-lattice` so it could also be
used with the `ml-kem` crate.

See RustCrypto/KEMs#309
2026-05-10 15:12:31 -06:00
Tony Arcieri fb08f196a7 ml-dsa: remove KeyGen trait (#1349)
It has been replaced by the `KeyInit` and `Generate` traits from the
`crypto-common` crate.

See also: #1342
2026-05-09 17:16:38 -06:00
Tony Arcieri a39b5af547 CI: add workspace-level doc check (#1348)
Ensures the docs for all crates build without warnings
ml-dsa/v0.1.0-rc.10
2026-05-09 17:02:21 -06:00
Tony Arcieri 0842fa86ff ml-dsa: add SigningKey::as_seed (#1347)
Provides a way of borrowing `&Seed` instead of making a copy as with
`SigningKey::to_seed`.
2026-05-09 17:00:38 -06:00
Tony Arcieri e7f6a601f9 ml-dsa: precompute VerifyingKeys when alloc enabled (#1346)
Adds an `alloc`-gated `verifying_key` field to `SigningKey`, and when
the feature is enabled precomputes the key at the time the `SigningKey`
is initialized.

We previously used to do this but stopped to optimize stack usage (see
the changes in #1259 and #1261), however when `alloc` is enabled this
isn't an issue since we've moved the relevant data to the heap in this
case (see #1344 and #1345), so stack usage is no longer an issue.

This makes it possible to implement `signature::KeypairRef` for
`SigningKey` which still provides a blanket `signature::Keypair` impl,
so we can always depend on the latter being availble but take advantage
of the former when `alloc` is enabled.
2026-05-09 16:21:34 -06:00
Tony Arcieri c3ded0c799 ml-dsa: use MaybeBox for SigningKey (#1345)
Opportunistically stores the parts of `SigningKey` on the heap when the
`alloc` feature is enabled, similar to what #1344 did for
`VerifyingKey`.

This also addresses #1308 by adding a `Drop` (and `ZeroizeOnDrop`) impl
to `SigningKey` which clears the `Seed`.
2026-05-09 16:03:49 -06:00
Tony Arcieri 7336ca4af8 ml-dsa: use MaybeBox to store VerifyingKey (#1344)
When the `alloc` feature is enabled, uses `Box` to offload the largest
parts of `VerifyingKey` to the heap.

This also extracts an internal `PrecomputedValues` struct to store the
largest components of the key, which are all derived/precomputed values,
as a single contiguous struct in a `MaybeBox`, and extracts some of the
relevant logic to it.
2026-05-09 15:28:23 -06:00
Tony Arcieri e3f07e9ce5 ml-dsa: expand usage docs (#1343) 2026-05-09 14:53:34 -06:00
Tony Arcieri 62fa7ac438 ml-dsa: implement KeyInit, KeyExport, KeySizeUser (#1342)
Implements these traits sourced from the `crypto-common` crate.

Also implements the `Generate` trait for key generation, replacing the
previous `KeyGen` trait, which this commit deprecates in favor of using
`KeyInit` and `Generate`.

This also adds a `getrandom` feature that forwards through to
`crypto-common`, making methods available on the `Generate` trait when
enabled.
2026-05-09 14:19:30 -06:00
Tony Arcieri 20b0095bd9 ml-dsa: factor from_seed method onto SigningKey (#1341)
Extracts a `SigningKey::from_seed` that was previously defined on
`MlDsaParams` via a trait impl.

This changes it to an inherent method, and has the trait method call the
inherent method.

This makes it possible to restrict the visibility of `SigningKey`
fields, addressing a TODO.
2026-05-08 10:12:42 -06:00
Tony Arcieri f9f4c60d78 ml-dsa: rename ExpandedSigningKey field/method to expanded_key (#1340)
This is a vestige from when `SigningKey` was a keypair type.

Also marks it `#[doc(hidden)]` as it exists primarily for testing.
2026-05-08 09:34:29 -06:00
Tony Arcieri e5f9f64231 ml-dsa: extract signing and verifying modules (#1339)
Extracts code previously in `lib.rs` related to the following types into
two modules:

- `signing`: `SigningKey`, `ExpandedSigningKey`
- `verifying`: `VerifyingKey`
2026-05-08 09:04:40 -06:00
Tony Arcieri 0c7cf02d1b ml-dsa: apply and fix workspace-level lints (#1338)
Applies the workspace-level config added in #1323 to this crate and
fixes any failures.
2026-05-07 21:14:26 -06:00
Tony Arcieri ebe040ee89 rfc6979 v0.5.0 (#1337) rfc6979/v0.5.0 2026-05-06 12:55:52 -06:00
xjd 4854bcfa4d ml-dsa: optimize rejection sampling in rej_(ntt|bounded)_poly (#1291)
It seems like filling matrix is a bottleneck of decoding encapsulation key.

With simple changes, it gets better performance.
2026-05-06 12:45:56 -06:00
dependabot[bot] 2399f8ae6e build(deps): bump digest from 0.11.2 to 0.11.3 (#1329) 2026-05-06 12:04:03 -06:00
Tony Arcieri 8c849e0e2f rfc6979: apply and fix workspace-level lints (#1336)
Applies the workspace-level config added in #1323 to this crate and
fixes any failures.
2026-05-06 11:54:08 -06:00
Tony Arcieri 78c2b75436 ed448 v0.5.0 (#1335) ed448/v0.5.0 2026-05-06 11:30:51 -06:00
Tony Arcieri 668b85189c ed448: apply and fix workspace-level lints (#1334)
Applies the workspace-level config added in #1323 to this crate and
fixes any failures.
2026-05-06 11:13:09 -06:00
Tony Arcieri 3f353f90ea ed448: use serdect for serde support (#1333)
Like #1324 did for `ed25519`, this uses the `serdect` crate for the
`serde` implementation, which is a breaking change.

See comments in #1324 for more information.
2026-05-06 10:43:42 -06:00
dependabot[bot] 2ac115c5fe build(deps): bump serdect from 0.4.2 to 0.4.3 (#1330) 2026-05-05 15:21:43 -06:00
Tony Arcieri d5012d5ba3 ed25519: add back serde_bytes support (#1332)
Since `serdect` changes the wire format, this should at least provide
backwards compatibility for `serde_bytes` users.
2026-05-05 15:09:40 -06:00
dependabot[bot] b60664ed3c build(deps): bump crate-ci/typos from 1.45.0 to 1.46.0 (#1331) 2026-05-04 14:16:34 -06:00
dependabot[bot] a1eb4e0982 build(deps): bump signature from 2.2.0 to 3.0.0 (#1328) 2026-05-04 13:44:28 -06:00
Tony Arcieri f2b087c0f3 ed25519 v3.0.0 (#1327) ed25519/v3.0.0 2026-05-03 10:28:50 -06:00
Tony Arcieri 9c1e1fc627 ed25519: fix Zeroize impl for Signature (#1326)
It wasn't actually using `Zeroize` on the underlying values
2026-05-03 10:06:36 -06:00
Tony Arcieri 01e41793c3 ed25519: remove rand_core dev-dependency (#1325)
It's out-of-date and seemingly unused, possibly tied to the interop
documentation which is currently disabled, but we can cross that bridge
when we get there
2026-05-03 09:54:22 -06:00
Tony Arcieri 3c97f39a05 ed25519: use serdect for serde support (#1324)
Follows suit with `serde` support in other RustCrypto crates by using
`serdect` to implement `Serialize` and `Deserialize`, replacing the
previous use of `serde_bytes`.

These serializers use the `serdect::array` serializers which use
efficient format-specific byte encodings (albeit with a length prefix)
when serializing to binary formats, or a hex encoding with human
readable formats like JSON and TOML.
2026-05-03 09:28:36 -06:00
Tony Arcieri 2d7866fa4c ed25519: configure and apply workspace-level lints (#1323)
Adds the workspace-level config from RustCrypto/utils#1411 to this
repo and applies it to `ed25519`.
2026-05-02 21:21:26 -06:00
Tony Arcieri e0d47990aa Update copyright year to 2026 (#1322) 2026-05-02 18:10:44 -06:00
Tony Arcieri 088a4fe7a4 Bump signature dependency to v3 (#1321)
Release PR: RustCrypto/traits#2400
2026-05-02 15:16:18 -06:00
Onyeka Obi 826baa3682 Implement Hash on non-secret Signature and VerifyingKey types (#1309)
Per #1229: Signature and public-key types lack `Hash`, which prevents
use in `HashMap` / `HashSet` keys and similar collections.

- ecdsa: Signature, DER Signature, SignatureWithOid
- ed25519: Signature, pkcs8::PublicKeyBytes
- ed448: Signature, pkcs8::PublicKeyBytes
- ml-dsa: Signature, VerifyingKey
- slh-dsa: Signature, VerifyingKey

Where a trivial derive works (ed25519, ed448), uses derive. Where
generic bounds or upstream gaps require it, uses a manual impl over
the canonical serialized bytes (`to_bytes` / `encode` / `as_bytes`),
which is the natural Hash domain for these types anyway.

Closes #1229
2026-05-01 16:17:15 -06:00
Tony Arcieri f3c409ee83 ml-dsa: add internal MaybeBox type (#1320)
Adds an internal type for opportunistic heap offload which uses `Box`
when the `alloc` feature is available and falls back to stack allocation
when it is not.

So far it's only used for the `z` component of `Signature` but is useful
elsewhere, e.g. for `VerifyingKey`.

It's so generally useful it should probably get extracted somewhere, to
`module-lattice` at the very least, but this is enough to get started.
2026-04-30 11:13:41 -06:00
Tony Arcieri 58bae19939 Cut new prereleases (#1319)
Releases the following, which all now depend either directly or
transitively on `pkcs8` v0.11 (which had breaking changes in the final
release)

- `dsa` v0.7.0-rc.15
- `ecdsa` v0.17.0-rc.18
- `ed25519` v3.0.0-rc.5
- `ed448` v0.5.0-rc.6
- `ml-dsa` v0.1.0-rc.9
- `slh-dsa` v0.2.0-rc.5
- `xmss` v0.1.0-pre.1
ml-dsa/v0.1.0-rc.9 slh-dsa/v0.2.0-rc.5 ecdsa/v0.17.0-rc.18 xmss/v0.1.0-pre.1 ed448/v0.5.0-rc.6 ed25519/v3.0.0-rc.5 dsa/v0.7.0-rc.15
2026-04-28 10:08:48 -06:00
Tony Arcieri 2eadc3c766 ml-dsa: bump module-lattice to v0.2.2 (#1318) 2026-04-28 09:36:10 -06:00
Tony Arcieri 452633d33a ecdsa: bump elliptic-curve to v0.14.0-rc.32 (#1317)
This version requires `pkcs8` v0.11
2026-04-28 09:35:52 -06:00
Tony Arcieri 86c035a74f Bump pkcs8 dependency to v0.11 (#1316)
Release PR: RustCrypto/formats#2314
2026-04-28 08:32:20 -06:00
dependabot[bot] f873b8e758 build(deps): bump hybrid-array from 0.4.10 to 0.4.11 (#1314) 2026-04-27 13:09:18 -06:00
Tony Arcieri d8b1875a9f Bump pkcs8 to v0.11.0-rc.12 (#1312) 2026-04-27 13:07:45 -06:00
dependabot[bot] 00e6eed7b2 build(deps): bump typenum from 1.19.0 to 1.20.0 (#1306) 2026-04-27 10:27:46 -06:00
Tony Arcieri f93d5022da ml-dsa: fix unreachable_pub lint by making Eta pub (#1311)
This lint started failing, seemingly as of Rust 1.95. Though this may
not be the best solution, to get the lint to pass again this makes `Eta`
pub.
2026-04-27 09:15:21 -06:00