Simplify bit flip in sha1.cpp

This commit is contained in:
ndren 2022-09-20 09:54:35 +01:00 committed by GitHub
parent 9acf2d3db7
commit 2c3f641e0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -103,7 +103,7 @@ void SHA1::process()
{ {
if( t < 20 ) { if( t < 20 ) {
K = 0x5a827999; K = 0x5a827999;
f = (b & c) | ((b ^ 0xFFFFFFFF) & d);//TODO: try using ~ f = (b & c) | ((~b) & d);
} else if( t < 40 ) { } else if( t < 40 ) {
K = 0x6ed9eba1; K = 0x6ed9eba1;
f = b ^ c ^ d; f = b ^ c ^ d;