Skip to content

Commit af5b7a5

Browse files
committed
doc: add the rustdoc clippy is asking for
1 parent 21a77dd commit af5b7a5

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

blake2/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ use digest::zeroize::{Zeroize, ZeroizeOnDrop};
3535
mod as_bytes;
3636
mod consts;
3737

38+
/// SIMD vector operations and types for Blake2 compression function.
3839
pub mod simd;
3940

4041
#[macro_use]

blake2/src/macros.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ macro_rules! blake2_impl {
77
#[derive(Clone)]
88
#[doc=$vardoc]
99
pub struct $name {
10+
/// Blake2 state vector (8 words total, stored as 2 SIMD vectors).
1011
pub h: [$vec; 2],
12+
/// Total number of bytes processed so far.
1113
pub t: u64,
1214
#[cfg(feature = "reset")]
15+
/// Initial state vector for reset functionality.
1316
pub h0: [$vec; 2],
1417
}
1518

blake2/src/simd.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,41 @@ mod simdty;
1212

1313
pub use self::simdty::{u32x4, u64x4};
1414

15+
/// SIMD vector operations for 4-element vectors used in Blake2 compression.
1516
pub trait Vector4<T>: Copy {
17+
/// Gather elements from a slice at specified indices into a 4-element vector.
1618
fn gather(src: &[T], i0: usize, i1: usize, i2: usize, i3: usize) -> Self;
1719

20+
/// Convert from little-endian byte order (no-op on little-endian targets).
1821
#[allow(clippy::wrong_self_convention)]
1922
fn from_le(self) -> Self;
23+
/// Convert to little-endian byte order (no-op on little-endian targets).
2024
fn to_le(self) -> Self;
2125

26+
/// Wrapping addition of two vectors.
2227
fn wrapping_add(self, rhs: Self) -> Self;
2328

29+
/// Rotate all elements right by a constant number of bits.
2430
fn rotate_right_const(self, n: u32) -> Self;
2531

32+
/// Shuffle elements left by 1 position: \[a,b,c,d\] -> \[b,c,d,a\].
2633
fn shuffle_left_1(self) -> Self;
34+
/// Shuffle elements left by 2 positions: \[a,b,c,d\] -> \[c,d,a,b\].
2735
fn shuffle_left_2(self) -> Self;
36+
/// Shuffle elements left by 3 positions: \[a,b,c,d\] -> \[d,a,b,c\].
2837
fn shuffle_left_3(self) -> Self;
2938

39+
/// Shuffle elements right by 1 position: \[a,b,c,d\] -> \[d,a,b,c\].
3040
#[inline(always)]
3141
fn shuffle_right_1(self) -> Self {
3242
self.shuffle_left_3()
3343
}
44+
/// Shuffle elements right by 2 positions: \[a,b,c,d\] -> \[c,d,a,b\].
3445
#[inline(always)]
3546
fn shuffle_right_2(self) -> Self {
3647
self.shuffle_left_2()
3748
}
49+
/// Shuffle elements right by 3 positions: \[a,b,c,d\] -> \[b,c,d,a\].
3850
#[inline(always)]
3951
fn shuffle_right_3(self) -> Self {
4052
self.shuffle_left_1()

blake2/src/simd/simdty.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ impl<T: Eq> Eq for Simd4<T> {}
7373

7474
pub type u64x2 = Simd2<u64>;
7575

76+
/// SIMD vector of four 32-bit unsigned integers.
7677
pub type u32x4 = Simd4<u32>;
78+
/// SIMD vector of four 64-bit unsigned integers.
7779
pub type u64x4 = Simd4<u64>;
7880

7981
pub type u16x8 = Simd8<u16>;

0 commit comments

Comments
 (0)