@@ -12,29 +12,41 @@ mod simdty;
1212
1313pub use self :: simdty:: { u32x4, u64x4} ;
1414
15+ /// SIMD vector operations for 4-element vectors used in Blake2 compression.
1516pub 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 ( )
0 commit comments