Skip to content

Commit

Permalink
sha2: restrict Self::MAX to tests, otherwise unused
Browse files Browse the repository at this point in the history
  • Loading branch information
brycx committed Aug 16, 2024
1 parent a1550d1 commit 0d4b4dd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/hazardous/hash/sha2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ pub(crate) mod sha2_core {
+ PartialEq<Self>
+ Zeroize
{
#[cfg(any(debug_assertions, test))]
const MAX: Self;

fn wrapping_add(&self, rhs: Self) -> Self;
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 0d4b4dd

Please sign in to comment.