Skip to content

Commit 84476d3

Browse files
authored
digest: remove Clone from MacTraits (#2341)
NOTE: this is a breaking change! We are doing it in spite of `digest` having a stable release as the downstream crates that depend on this functionality have not yet had stable releases, so it should only impact people who are currently relying on prereleases
1 parent 6954eab commit 84476d3

5 files changed

Lines changed: 22 additions & 13 deletions

File tree

Cargo.lock

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,4 @@ unused_qualifications = "warn"
5757
crypto-common = { path = "crypto-common" }
5858
digest = { path = "digest" }
5959
signature = { path = "signature" }
60+
hmac = { git = "https://github.com/RustCrypto/MACs" }

digest/CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## 0.11.1 (2026-02-25)
8+
## 0.11.2 (UNRELEASED)
9+
### Changed
10+
- Do not implement `Clone` as part of `(Reset)MacTraits` in the `buffer_fixed!` macro ([#2341])
11+
- `EagerHash` trait to be a sub-trait of `Clone` ([#2341])
12+
13+
[#2341]: https://github.com/RustCrypto/traits/pull/2341
14+
15+
## 0.11.1 (2026-02-25) [YANKED]
16+
Note: this version was yanked because v0.11.2 introduces minor breaking changes
17+
affecting only pre-release versions of downstream crates.
18+
919
### Added
1020
- `SmallBlockSizeUser` helper trait. The trait is a sub-trait of `BlockSizeUser`
1121
with `BlockSize` bounded by `block_buffer::BlockSizes`. ([#2309])

digest/src/block_api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub trait BufferKindUser: SmallBlockSizeUser {
5252
}
5353

5454
/// Trait implemented by eager hashes which expose their block-level core.
55-
pub trait EagerHash: SmallBlockSizeUser + Digest {
55+
pub trait EagerHash: SmallBlockSizeUser + Digest + Clone {
5656
/// Block-level core type of the hash.
5757
type Core: HashMarker
5858
+ UpdateCore
@@ -65,7 +65,7 @@ pub trait EagerHash: SmallBlockSizeUser + Digest {
6565

6666
impl<T> EagerHash for T
6767
where
68-
T: CoreProxy + SmallBlockSizeUser + Digest,
68+
T: CoreProxy + SmallBlockSizeUser + Digest + Clone,
6969
<T as CoreProxy>::Core: HashMarker
7070
+ UpdateCore
7171
+ FixedOutputCore

digest/src/buffer_macros/fixed.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ macro_rules! buffer_fixed {
6565
};
6666

6767
// Implements the set of traits common for MAC functions:
68-
// `Debug`, `BlockSizeUser`, `OutputSizeUser`, `CoreProxy`, `Update`, `FixedOutput`,
69-
// `Clone`, `MacMarker`.
68+
// `Debug`, `BlockSizeUser`, `OutputSizeUser`, `CoreProxy`, `Update`, `FixedOutput`, `MacMarker`
7069
(
7170
impl_inner: $name:ident
7271
$(< $( $lt:tt $( : $clt:tt $(+ $dlt:tt )* )? ),+ >)?
@@ -75,13 +74,13 @@ macro_rules! buffer_fixed {
7574
) => {
7675
$crate::buffer_fixed!(
7776
impl_inner: $name$(< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)?($core_ty);
78-
BaseFixedTraits Clone MacMarker $($trait_name)*;
77+
BaseFixedTraits MacMarker $($trait_name)*;
7978
);
8079
};
8180

8281
// Implements the set of traits common for resettable MAC functions:
8382
// `Debug`, `BlockSizeUser`, `OutputSizeUser`, `CoreProxy`, `Update`, `FixedOutput`,
84-
// `Clone`, `MacMarker`, `Reset`, `FixedOutputReset`.
83+
// `MacMarker`, `Reset`, `FixedOutputReset`.
8584
(
8685
impl_inner: $name:ident
8786
$(< $( $lt:tt $( : $clt:tt $(+ $dlt:tt )* )? ),+ >)?

0 commit comments

Comments
 (0)