What changed, and why it matters
This commit only fixes typos and formatting in documentation comments and test file comments. No code behavior changes.
Recommended action
No action needed; this is a non-functional documentation cleanup commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff consists entirely of cosmetic documentation edits: capitalizing the first word of doc comments, adding missing periods, correcting ‘units’ to ‘hashes’ in a test module comment, and fixing spelling/grammar in test file comments. There are no executable code changes.
Changed components
hashes/src/sha256/crypto/arm_sha2.rshashes/src/sha256/crypto/avx2.rshashes/src/sha256/crypto/sse41.rshashes/src/sha256/crypto/x86_shani.rshashes/tests/api.rshashes/tests/chunk_combinations.rshashes/tests/nist_cavp.rsInspect captured patch +10 / −10
diff --git a/hashes/src/sha256/crypto/arm_sha2.rs b/hashes/src/sha256/crypto/arm_sha2.rs
index be57d1b6..81b57ddb 100644
--- a/hashes/src/sha256/crypto/arm_sha2.rs
+++ b/hashes/src/sha256/crypto/arm_sha2.rs
@@ -205,7 +205,7 @@ pub(super) unsafe fn process_blocks(state: &mut [u32; 8], blocks: &[u8]) {
vst1q_u32(state.as_mut_ptr().add(4), state1);
}
-/// computes `SHA256d` of two 64-byte inputs in parallel using ARM SHA2 intrinsics.
+/// Computes `SHA256d` of two 64-byte inputs in parallel using ARM SHA2 intrinsics.
#[target_feature(enable = "sha2")]
pub(super) unsafe fn sha256d_64_2way(output: &mut [[u8; 32]; 2], input: &[[u8; 64]; 2]) {
// Based on Bitcoin Core's sha256d64_arm_shani::Transform_2way
diff --git a/hashes/src/sha256/crypto/avx2.rs b/hashes/src/sha256/crypto/avx2.rs
index 7f57b9b4..64b41b61 100644
--- a/hashes/src/sha256/crypto/avx2.rs
+++ b/hashes/src/sha256/crypto/avx2.rs
@@ -143,7 +143,7 @@ unsafe fn Write8(output: &mut [[u8; 32]; 8], offset: usize, v: __m256i) {
output[7][offset..offset + 4].copy_from_slice(&_mm256_extract_epi32::<0>(v).to_le_bytes());
}
-/// Computes `SHA256d` of eight 64-byte inputs in parallel using AVX2
+/// Computes `SHA256d` of eight 64-byte inputs in parallel using AVX2.
#[target_feature(enable = "avx,avx2")]
#[rustfmt::skip]
pub(super) unsafe fn sha256d_64_8way(output: &mut [[u8; 32]; 8], input: &[[u8; 64]; 8]) {
diff --git a/hashes/src/sha256/crypto/sse41.rs b/hashes/src/sha256/crypto/sse41.rs
index 5707cceb..b29ecc00 100644
--- a/hashes/src/sha256/crypto/sse41.rs
+++ b/hashes/src/sha256/crypto/sse41.rs
@@ -125,7 +125,7 @@ unsafe fn Write4(output: &mut [[u8; 32]; 4], offset: usize, v: __m128i) {
output[3][offset..offset + 4].copy_from_slice(&_mm_extract_epi32::<0>(v).to_le_bytes());
}
-/// Computes `SHA256d` of four 64-byte inputs in parallel using SSE4.1
+/// Computes `SHA256d` of four 64-byte inputs in parallel using SSE4.1.
#[target_feature(enable = "sse2,ssse3,sse4.1")]
#[rustfmt::skip]
pub(super) unsafe fn sha256d_64_4way(output: &mut [[u8; 32]; 4], input: &[[u8; 64]; 4]) {
diff --git a/hashes/src/sha256/crypto/x86_shani.rs b/hashes/src/sha256/crypto/x86_shani.rs
index e5edde20..3bb25ced 100644
--- a/hashes/src/sha256/crypto/x86_shani.rs
+++ b/hashes/src/sha256/crypto/x86_shani.rs
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: CC0-1.0
-//! x86 SHA-NI intrinsics for sha256
+//! x86 SHA-NI intrinsics for SHA256.
#![allow(clippy::cast_ptr_alignment)]
diff --git a/hashes/tests/api.rs b/hashes/tests/api.rs
index 9c1937c2..eca69322 100644
--- a/hashes/tests/api.rs
+++ b/hashes/tests/api.rs
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: CC0-1.0
-//! Test the API surface of `units`.
+//! Test the API surface of `hashes`.
//!
//! The point of these tests is to check the API surface as opposed to test the API functionality.
//!
diff --git a/hashes/tests/chunk_combinations.rs b/hashes/tests/chunk_combinations.rs
index f002ad63..b6c91d42 100644
--- a/hashes/tests/chunk_combinations.rs
+++ b/hashes/tests/chunk_combinations.rs
@@ -4,13 +4,13 @@
//! verifies that feeding the same bytes via three `engine.input()` calls
//! matches one-shot hashing.
//!
-//! This catches bugs that byte-by-byte incremetal tests in `nist_cavp.rs` don't catch.
-//! especially block-boundary transitions, empty chunks or buffering bugs.
+//! This catches bugs that byte-by-byte incremental tests in `nist_cavp.rs` don't catch,
+//! especially block-boundary transitions, empty chunks, or buffering bugs.
//!
//! Inspired by `ring` `test_i_u_f` tests:
//! <https://github.com/briansmith/ring/commit/5daff2c0e1bb8ef00e44e15b0531dda0b69d0ec5>
//!
-//! These tests are slow, so they only run in release mode
+//! These tests are slow, so they only run in release mode.
#[cfg(not(debug_assertions))]
use bitcoin_hashes::HashEngine as _;
diff --git a/hashes/tests/nist_cavp.rs b/hashes/tests/nist_cavp.rs
index 9d89d092..df1a095f 100644
--- a/hashes/tests/nist_cavp.rs
+++ b/hashes/tests/nist_cavp.rs
@@ -6,7 +6,7 @@
//! <https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program>
//!
-/// Tests both one-shot and incremental hashing
+/// Tests both one-shot and incremental hashing.
macro_rules! nist_shavs_tests {
($mod_name:ident, $hash_type:ty, $short_file:expr, $long_file:expr) => {
mod $mod_name {
@@ -81,7 +81,7 @@ nist_shavs_tests!(
"data/nist/SHA3_256LongMsg.rsp"
);
-/// Runs NIST SHAVS tests from .rsp files
+/// Runs NIST SHAVS tests from `.rsp` files.
fn run_shavs_tests<F>(content: &str, hash_fn: F)
where
F: Fn(&[u8]) -> Vec<u8>,
Risk score
Our methodology →Why this scored 15/100
Human-validated context
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
No validated notes yet.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.