1
1
/*
2
- * Copyright (c) 2002, 2021 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2002, 2022 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -156,14 +156,14 @@ private void implCompress0(byte[] buf, int ofs) {
156
156
157
157
// delta0(x) = S(x, 7) ^ S(x, 18) ^ R(x, 3)
158
158
int delta0_W_t15 =
159
- (( W_t15 >>> 7 ) | ( W_t15 << 25 ) ) ^
160
- (( W_t15 >>> 18 ) | ( W_t15 << 14 ) ) ^
159
+ Integer . rotateRight ( W_t15 , 7 ) ^
160
+ Integer . rotateRight ( W_t15 , 18 ) ^
161
161
(W_t15 >>> 3 );
162
162
163
163
// delta1(x) = S(x, 17) ^ S(x, 19) ^ R(x, 10)
164
164
int delta1_W_t2 =
165
- (( W_t2 >>> 17 ) | ( W_t2 << 15 ) ) ^
166
- (( W_t2 >>> 19 ) | ( W_t2 << 13 ) ) ^
165
+ Integer . rotateRight ( W_t2 , 17 ) ^
166
+ Integer . rotateRight ( W_t2 , 19 ) ^
167
167
(W_t2 >>> 10 );
168
168
169
169
W [t ] = delta0_W_t15 + delta1_W_t2 + W [t -7 ] + W [t -16 ];
@@ -184,15 +184,15 @@ private void implCompress0(byte[] buf, int ofs) {
184
184
185
185
// sigma0(x) = S(x,2) xor S(x,13) xor S(x,22)
186
186
int sigma0_a =
187
- (( a >>> 2 ) | ( a << 30 ) ) ^
188
- (( a >>> 13 ) | ( a << 19 ) ) ^
189
- (( a >>> 22 ) | ( a << 10 ) );
187
+ Integer . rotateRight ( a , 2 ) ^
188
+ Integer . rotateRight ( a , 13 ) ^
189
+ Integer . rotateRight ( a , 22 );
190
190
191
191
// sigma1(x) = S(x,6) xor S(x,11) xor S(x,25)
192
192
int sigma1_e =
193
- (( e >>> 6 ) | ( e << 26 ) ) ^
194
- (( e >>> 11 ) | ( e << 21 ) ) ^
195
- (( e >>> 25 ) | ( e << 7 ) );
193
+ Integer . rotateRight ( e , 6 ) ^
194
+ Integer . rotateRight ( e , 11 ) ^
195
+ Integer . rotateRight ( e , 25 );
196
196
197
197
// ch(x,y,z) = (x and y) xor ((complement x) and z)
198
198
int ch_efg = (e & f ) ^ ((~e ) & g );
0 commit comments