What changed, and why it matters
This commit is purely a code formatting cleanup. It only reorders an import statement, removes extra blank lines, and reformats an array literal to fit style guidelines. There are no functional changes to the SHA-256 hashing code.
No action needed; this is a non-functional style-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff shows only cosmetic changes in hashes/src/sha256/crypto.rs: moving use super::{...} above use crate::sha256d;, collapsing a multi-line const array into one line, removing trailing whitespace on a blank line, and removing an extra blank line. No logic, constants, or control flow were altered.
Changed components
hashes/src/sha256/crypto.rsInspect captured patch +3 / −7
diff --git a/hashes/src/sha256/crypto.rs b/hashes/src/sha256/crypto.rs
index efe03045..9eaec39a 100644
--- a/hashes/src/sha256/crypto.rs
+++ b/hashes/src/sha256/crypto.rs
@@ -25,9 +25,8 @@ use core::arch::x86_64::{
use internals::slice::SliceExt;
-use crate::sha256d;
-
use super::{HashEngine, Midstate, BLOCK_SIZE};
+use crate::sha256d;
#[cfg(all(feature = "cpufeatures", target_arch = "aarch64"))]
// cpufeatures crate internally uses `u8::max_value()` which will be deprecated.
@@ -895,9 +894,7 @@ impl HashEngine {
];
// Padding processed in the 3rd transform (byteswapped).
- const FINAL: [u32; 8] = [
- 0x80000000, 0, 0, 0, 0, 0, 0, 0x100,
- ];
+ const FINAL: [u32; 8] = [0x80000000, 0, 0, 0, 0, 0, 0, 0x100];
let (mut state0_a, mut state0_b, mut state1_a, mut state1_b);
let (abcd_save_a, abcd_save_b, efgh_save_a, efgh_save_b);
@@ -931,7 +928,7 @@ impl HashEngine {
msg1_b = vreinterpretq_u32_u8(vrev32q_u8(vreinterpretq_u8_u32(msg1_b)));
msg2_b = vreinterpretq_u32_u8(vrev32q_u8(vreinterpretq_u8_u32(msg2_b)));
msg3_b = vreinterpretq_u32_u8(vrev32q_u8(vreinterpretq_u8_u32(msg3_b)));
-
+
// Transform 1: Rounds 1-4
tmp = vld1q_u32(K.as_ptr().add(0));
tmp0_a = vaddq_u32(msg0_a, tmp);
@@ -1574,7 +1571,6 @@ impl HashEngine {
vst1q_u8(output[1].as_mut_ptr().add(16), vrev32q_u8(vreinterpretq_u8_u32(state1_b)));
}
-
// Algorithm copied from libsecp256k1
fn software_process_block(state: &mut [u32; 8], blocks: &[u8]) {
debug_assert!(!blocks.is_empty() && blocks.len() % BLOCK_SIZE == 0);
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.