From a75a7bfffd10d6fb54a61f4ca2b17b24d796982a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Tue, 12 May 2026 14:35:06 +0300 Subject: [PATCH 1/3] Remove `BlockSizeUser` impls for XOFs --- cshake/src/lib.rs | 12 ++---------- k12/src/custom/borrow.rs | 12 ++---------- k12/src/custom/owned.rs | 12 ++---------- k12/src/lib.rs | 12 ++---------- turboshake/src/lib.rs | 12 ++---------- 5 files changed, 10 insertions(+), 50 deletions(-) diff --git a/cshake/src/lib.rs b/cshake/src/lib.rs index 2d73e7268..8568fc018 100644 --- a/cshake/src/lib.rs +++ b/cshake/src/lib.rs @@ -14,8 +14,8 @@ pub use digest; use core::fmt; use digest::{ CollisionResistance, CustomizedInit, ExtendableOutput, HashMarker, Update, XofReader, - common::{AlgorithmName, BlockSizeUser}, - consts::{U16, U32, U136, U168}, + common::AlgorithmName, + consts::{U16, U32}, }; use keccak::{Keccak, State1600}; use sponge_cursor::SpongeCursor; @@ -238,11 +238,3 @@ impl CollisionResistance for CShake128 { impl CollisionResistance for CShake256 { type CollisionResistance = U32; } - -impl BlockSizeUser for CShake128 { - type BlockSize = U168; -} - -impl BlockSizeUser for CShake256 { - type BlockSize = U136; -} diff --git a/k12/src/custom/borrow.rs b/k12/src/custom/borrow.rs index d8a869823..9ca4d696d 100644 --- a/k12/src/custom/borrow.rs +++ b/k12/src/custom/borrow.rs @@ -1,8 +1,8 @@ use core::fmt; use digest::{ CollisionResistance, ExtendableOutput, ExtendableOutputReset, HashMarker, Reset, Update, - common::{AlgorithmName, BlockSizeUser}, - consts::{U16, U32, U136, U168}, + common::AlgorithmName, + consts::{U16, U32}, }; use crate::{Kt, KtReader, utils::length_encode}; @@ -109,11 +109,3 @@ impl CollisionResistance for CustomRefKt128<'_> { impl CollisionResistance for CustomRefKt256<'_> { type CollisionResistance = U32; } - -impl BlockSizeUser for CustomRefKt128<'_> { - type BlockSize = U168; -} - -impl BlockSizeUser for CustomRefKt256<'_> { - type BlockSize = U136; -} diff --git a/k12/src/custom/owned.rs b/k12/src/custom/owned.rs index 44e37be2e..93dcf5827 100644 --- a/k12/src/custom/owned.rs +++ b/k12/src/custom/owned.rs @@ -5,8 +5,8 @@ use core::fmt; use digest::{ CollisionResistance, CustomizedInit, ExtendableOutput, ExtendableOutputReset, HashMarker, Reset, Update, - common::{AlgorithmName, BlockSizeUser}, - consts::{U16, U32, U136, U168}, + common::AlgorithmName, + consts::{U16, U32}, }; use crate::{Kt, KtReader, utils::length_encode}; @@ -122,11 +122,3 @@ impl CollisionResistance for CustomKt256 { // https://www.rfc-editor.org/rfc/rfc9861.html#section-7-8 type CollisionResistance = U32; } - -impl BlockSizeUser for CustomKt128 { - type BlockSize = U168; -} - -impl BlockSizeUser for CustomKt256 { - type BlockSize = U136; -} diff --git a/k12/src/lib.rs b/k12/src/lib.rs index d21a6090f..95916db91 100644 --- a/k12/src/lib.rs +++ b/k12/src/lib.rs @@ -13,8 +13,8 @@ pub use digest; use core::fmt; use digest::{ CollisionResistance, ExtendableOutput, ExtendableOutputReset, HashMarker, Reset, Update, - common::{AlgorithmName, BlockSizeUser}, - consts::{U16, U32, U136, U168}, + common::AlgorithmName, + consts::{U16, U32}, }; mod consts; @@ -181,11 +181,3 @@ impl CollisionResistance for Kt128 { impl CollisionResistance for Kt256 { type CollisionResistance = U32; } - -impl BlockSizeUser for Kt128 { - type BlockSize = U168; -} - -impl BlockSizeUser for Kt256 { - type BlockSize = U136; -} diff --git a/turboshake/src/lib.rs b/turboshake/src/lib.rs index ce552f7ad..e580d2746 100644 --- a/turboshake/src/lib.rs +++ b/turboshake/src/lib.rs @@ -17,8 +17,8 @@ use core::fmt; use digest::{ CollisionResistance, ExtendableOutput, ExtendableOutputReset, HashMarker, Reset, Update, XofReader, - common::{AlgorithmName, BlockSizeUser}, - consts::{U16, U32, U136, U168}, + common::AlgorithmName, + consts::{U16, U32}, }; /// Number of Keccak rounds used by TurboSHAKE. @@ -211,11 +211,3 @@ impl CollisionResistance for TurboShake256 { // https://www.ietf.org/archive/id/draft-irtf-cfrg-kangarootwelve-17.html#section-7-8 type CollisionResistance = U32; } - -impl BlockSizeUser for TurboShake128 { - type BlockSize = U168; -} - -impl BlockSizeUser for TurboShake256 { - type BlockSize = U136; -} From 8f8d8600405e0df16ba8443b7f59b9087b36fa38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Tue, 12 May 2026 14:39:07 +0300 Subject: [PATCH 2/3] update SHAKE impl --- sha3/src/shake.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/sha3/src/shake.rs b/sha3/src/shake.rs index 3644e7461..a395d30c5 100644 --- a/sha3/src/shake.rs +++ b/sha3/src/shake.rs @@ -3,10 +3,10 @@ use digest::{ CollisionResistance, ExtendableOutput, ExtendableOutputReset, HashMarker, Reset, Update, XofReader, common::{ - AlgorithmName, BlockSizeUser, + AlgorithmName, hazmat::{DeserializeStateError, SerializableState, SerializedState}, }, - consts::{U16, U32, U136, U168, U201}, + consts::{U16, U32, U201}, }; use keccak::{Keccak, State1600}; use sponge_cursor::SpongeCursor; @@ -222,14 +222,7 @@ impl Drop for ShakeReader { impl CollisionResistance for Shake128 { type CollisionResistance = U16; } + impl CollisionResistance for Shake256 { type CollisionResistance = U32; } - -impl BlockSizeUser for Shake128 { - type BlockSize = U168; -} - -impl BlockSizeUser for Shake256 { - type BlockSize = U136; -} From 0cd248bd291fc751ad71cdf11fab6a4d16070c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Tue, 12 May 2026 14:42:45 +0300 Subject: [PATCH 3/3] Update changelogs --- cshake/CHANGELOG.md | 4 ++++ k12/CHANGELOG.md | 4 ++++ turboshake/CHANGELOG.md | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/cshake/CHANGELOG.md b/cshake/CHANGELOG.md index a54122567..fcd8a28a9 100644 --- a/cshake/CHANGELOG.md +++ b/cshake/CHANGELOG.md @@ -13,8 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Internal implementation by removing unnecessary buffering ([#849]) - `Rate: BlockSizes` generic parameter to `const RATE: usize` ([#849]) +### Removed +- Implementations of `BlockSizeUser` ([#856]) + [#849]: https://github.com/RustCrypto/hashes/pull/849 [#855]: https://github.com/RustCrypto/hashes/pull/855 +[#856]: https://github.com/RustCrypto/hashes/pull/856 ## 0.1.1 (2026-04-19) ### Fixed diff --git a/k12/CHANGELOG.md b/k12/CHANGELOG.md index 5e5fcd451..dfd0ebc38 100644 --- a/k12/CHANGELOG.md +++ b/k12/CHANGELOG.md @@ -10,7 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Internal implementation by removing unnecessary buffering ([#849]) - `Rate: BlockSizes` generic parameter to `const RATE: usize` ([#849]) +### Removed +- Implementations of `BlockSizeUser` ([#856]) + [#849]: https://github.com/RustCrypto/hashes/pull/849 +[#856]: https://github.com/RustCrypto/hashes/pull/856 ## 0.4.0 (2026-04-24) ### Added diff --git a/turboshake/CHANGELOG.md b/turboshake/CHANGELOG.md index 7164a85e1..e32e68198 100644 --- a/turboshake/CHANGELOG.md +++ b/turboshake/CHANGELOG.md @@ -10,7 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Internal implementation by removing unnecessary buffering ([#849]) - `Rate: BlockSizes` generic parameter to `const RATE: usize` ([#849]) +### Removed +- Implementations of `BlockSizeUser` ([#856]) + [#849]: https://github.com/RustCrypto/hashes/pull/849 +[#856]: https://github.com/RustCrypto/hashes/pull/856 ## 0.6.0 (2026-04-24) Note: the crate was transferred to RustCrypto from https://github.com/itzmeanjan/turboshake