From 2c3f641e0ba45abf62cf0ec80ab800f3411bf158 Mon Sep 17 00:00:00 2001 From: ndren Date: Tue, 20 Sep 2022 09:54:35 +0100 Subject: [PATCH] Simplify bit flip in sha1.cpp --- src/util/sha1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/sha1.cpp b/src/util/sha1.cpp index d61b262af..ba95909ff 100644 --- a/src/util/sha1.cpp +++ b/src/util/sha1.cpp @@ -103,7 +103,7 @@ void SHA1::process() { if( t < 20 ) { K = 0x5a827999; - f = (b & c) | ((b ^ 0xFFFFFFFF) & d);//TODO: try using ~ + f = (b & c) | ((~b) & d); } else if( t < 40 ) { K = 0x6ed9eba1; f = b ^ c ^ d;