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
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
NOTE: temporarily excludes `slh-dsa` from the workspace until `rand` is
bumped because it is the only crate that depends on it
Release notes:
https://github.com/rust-random/rand_core/releases/tag/v0.10.0
Also bumps the following:
- `chacha20` v0.10.0-rc.10
- `cipher` v0.5.0-rc.7
- `crypto-bigint` v0.7.0-rc.24
- `crypto-common` v0.2.0-rc.14
- `digest` v0.11.0-rc.10
- `elliptic-curve` v0.14.0-rc.27
- `signature` v3.0.0-rc.10
Releases new versions of everything except `dsa` and `ecdsa` (since we
previously released those) which include the `rand_core` v0.10.0-rc-6
upgrade (as well as the associated `signature` v3.0.0-rc.9 release).
The `ml-dsa` crate contains a fix for #1176.
Releases the following:
- `ed25519` v3.0.0-rc.3
- `ed448` v0.5.0-rc.3
- `lms-signature` v0.1.0-rc.1
- `ml-dsa` v0.1.0-rc.4
- `rfc6979` v0.5.0-rc.4
- `slh-dsa` v0.2.0-rc.3
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.
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).
The `AsBytes` trait is gone, and now found on the `IntoBytes` trait.
It needs a new `Immutable` marker trait which says:
> Types which are free from interior mutability.
...so it seems safe to add to the types that previously used `AsBytes`
which are simple data structs.