What changed, and why it matters
This commit is a pure code cleanup: it renames an internal helper macro from `engine_input_impl!` to `impl_engine_input!` and switches its syntax from parentheses to curly braces. No logic, behavior, or security properties of the hashing code change.
No security action needed; this is a non-functional refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff renames the internal macro engine_input_impl! to impl_engine_input! across hashes/src/internal_macros.rs and all call sites (ripemd160, sha1, sha256, sha3_256, sha512). It also changes the macro definition syntax from macro_rules! name( ... ) to macro_rules! name { ... }. The macro body that implements HashEngine::input is byte-for-byte identical. There are no functional changes.
Changed components
hashes/src/internal_macros.rshashes/src/ripemd160/mod.rshashes/src/sha1/mod.rshashes/src/sha256/mod.rshashes/src/sha3_256/mod.rshashes/src/sha512/mod.rsInspect captured patch +10 / −10
diff --git a/hashes/src/internal_macros.rs b/hashes/src/internal_macros.rs
index ea7860ed..2198e8a2 100644
--- a/hashes/src/internal_macros.rs
+++ b/hashes/src/internal_macros.rs
@@ -198,8 +198,8 @@ macro_rules! impl_write {
}
pub(crate) use impl_write;
-macro_rules! engine_input_impl(
- () => (
+macro_rules! impl_engine_input {
+ () => {
#[cfg(not(hashes_fuzz))]
fn input(&mut self, mut inp: &[u8]) {
let buf_idx = $crate::incomplete_block_len(self);
@@ -237,6 +237,6 @@ macro_rules! engine_input_impl(
}
self.bytes_hashed += inp.len() as u64;
}
- )
-);
-pub(crate) use engine_input_impl;
+ }
+}
+pub(crate) use impl_engine_input;
diff --git a/hashes/src/ripemd160/mod.rs b/hashes/src/ripemd160/mod.rs
index e4512a23..ac51f64d 100644
--- a/hashes/src/ripemd160/mod.rs
+++ b/hashes/src/ripemd160/mod.rs
@@ -94,6 +94,6 @@ impl crate::HashEngine for HashEngine {
const BLOCK_SIZE: usize = 64;
fn n_bytes_hashed(&self) -> u64 { self.bytes_hashed }
- crate::internal_macros::engine_input_impl!();
+ crate::internal_macros::impl_engine_input!();
fn finalize(self) -> Self::Hash { Hash::from_engine(self) }
}
diff --git a/hashes/src/sha1/mod.rs b/hashes/src/sha1/mod.rs
index 24a6cc78..5257e2a6 100644
--- a/hashes/src/sha1/mod.rs
+++ b/hashes/src/sha1/mod.rs
@@ -86,7 +86,7 @@ impl crate::HashEngine for HashEngine {
fn n_bytes_hashed(&self) -> u64 { self.bytes_hashed }
- crate::internal_macros::engine_input_impl!();
+ crate::internal_macros::impl_engine_input!();
fn finalize(self) -> Self::Hash { Hash::from_engine(self) }
}
diff --git a/hashes/src/sha256/mod.rs b/hashes/src/sha256/mod.rs
index b0492e96..bcac3ddc 100644
--- a/hashes/src/sha256/mod.rs
+++ b/hashes/src/sha256/mod.rs
@@ -169,7 +169,7 @@ impl crate::HashEngine for HashEngine {
const BLOCK_SIZE: usize = 64;
fn n_bytes_hashed(&self) -> u64 { self.bytes_hashed }
- crate::internal_macros::engine_input_impl!();
+ crate::internal_macros::impl_engine_input!();
fn finalize(self) -> Self::Hash { Hash::from_engine(self) }
}
diff --git a/hashes/src/sha3_256/mod.rs b/hashes/src/sha3_256/mod.rs
index 6e9c841c..d0b8f405 100644
--- a/hashes/src/sha3_256/mod.rs
+++ b/hashes/src/sha3_256/mod.rs
@@ -214,7 +214,7 @@ impl crate::HashEngine for HashEngine {
type Hash = Hash;
const BLOCK_SIZE: usize = RATE;
- crate::internal_macros::engine_input_impl!();
+ crate::internal_macros::impl_engine_input!();
fn n_bytes_hashed(&self) -> u64 { self.bytes_hashed }
diff --git a/hashes/src/sha512/mod.rs b/hashes/src/sha512/mod.rs
index 0bfed793..928d2b67 100644
--- a/hashes/src/sha512/mod.rs
+++ b/hashes/src/sha512/mod.rs
@@ -127,6 +127,6 @@ impl crate::HashEngine for HashEngine {
const BLOCK_SIZE: usize = 128;
fn n_bytes_hashed(&self) -> u64 { self.bytes_hashed }
- crate::internal_macros::engine_input_impl!();
+ crate::internal_macros::impl_engine_input!();
fn finalize(self) -> Self::Hash { Hash::from_engine(self) }
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.