mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8294073: Performance improvement for message digest implementations
Reviewed-by: jjiang
This commit is contained in:
parent
57f5cfdeb5
commit
b366d17a94
1 changed files with 4 additions and 2 deletions
|
@ -195,10 +195,12 @@ abstract class SHA2 extends DigestBase {
|
|||
Integer.rotateRight(e, 25);
|
||||
|
||||
// ch(x,y,z) = (x and y) xor ((complement x) and z)
|
||||
int ch_efg = (e & f) ^ ((~e) & g);
|
||||
// = z xor (x and (y xor z));
|
||||
int ch_efg = g ^ (e & (f ^ g));
|
||||
|
||||
// maj(x,y,z) = (x and y) xor (x and z) xor (y and z)
|
||||
int maj_abc = (a & b) ^ (a & c) ^ (b & c);
|
||||
// = (x and y) xor ((x xor y) and z)
|
||||
int maj_abc = (a & b) ^ ((a ^ b) & c);
|
||||
|
||||
int T1 = h + sigma1_e + ch_efg + ROUND_CONSTS[i] + W[i];
|
||||
int T2 = sigma0_a + maj_abc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue