From 0d4b4dd0d4848d9fd08f2de3ed49f3e2c2157de6 Mon Sep 17 00:00:00 2001 From: brycx Date: Fri, 16 Aug 2024 09:41:46 +0200 Subject: [PATCH] sha2: restrict Self::MAX to tests, otherwise unused --- src/hazardous/hash/sha2/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hazardous/hash/sha2/mod.rs b/src/hazardous/hash/sha2/mod.rs index 2f5fc230..586a60d9 100644 --- a/src/hazardous/hash/sha2/mod.rs +++ b/src/hazardous/hash/sha2/mod.rs @@ -51,6 +51,7 @@ pub(crate) mod sha2_core { + PartialEq + Zeroize { + #[cfg(any(debug_assertions, test))] const MAX: Self; fn wrapping_add(&self, rhs: Self) -> Self; @@ -476,6 +477,7 @@ pub(crate) mod w32 { } impl super::sha2_core::Word for WordU32 { + #[cfg(any(debug_assertions, test))] const MAX: Self = Self(u32::MAX); #[inline] @@ -618,6 +620,7 @@ pub(crate) mod w64 { } impl super::sha2_core::Word for WordU64 { + #[cfg(any(debug_assertions, test))] const MAX: Self = Self(u64::MAX); #[inline]