Commit 46b6aee 1 parent c5a6229 commit 46b6aee Copy full SHA for 46b6aee
File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 5
5
// Auxiliary mappings; names as in FIPS PUB 180-4
6
6
fn rotr32 (a : u32 , b : u32 ) -> u32 // 32-bit right rotation
7
7
{
8
- (a >> b ) | (a << (32 as u32 - b ))
8
+ // None of the bits overlap between `(a >> b)` and `(a << (32 - b))`
9
+ // Addition is then equivalent to OR, with fewer constraints.
10
+ (a >> b ) + (a << (32 as u32 - b ))
9
11
}
10
12
11
13
fn ch (x : u32 , y : u32 , z : u32 ) -> u32
Original file line number Diff line number Diff line change 5
5
// Auxiliary mappings; names as in FIPS PUB 180-4
6
6
fn rotr64 (a : u64 , b : u64 ) -> u64 // 64-bit right rotation
7
7
{
8
- (a >> b ) | (a << (64 - b ))
8
+ // None of the bits overlap between `(a >> b)` and `(a << (64 - b))`
9
+ // Addition is then equivalent to OR, with fewer constraints.
10
+ (a >> b ) + (a << (64 - b ))
9
11
}
10
12
11
13
fn sha_ch (x : u64 , y : u64 , z : u64 ) -> u64
You can’t perform that action at this time.
0 commit comments