From 669dcdb42908337afa2a19cfc532aa17716beec7 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Mon, 30 Nov 2020 05:58:34 -0500 Subject: Break complicated expression down into several statements --- src/lib/block/blowfish/blowfish.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/lib/block') diff --git a/src/lib/block/blowfish/blowfish.cpp b/src/lib/block/blowfish/blowfish.cpp index 34e49c424..70fed4132 100644 --- a/src/lib/block/blowfish/blowfish.cpp +++ b/src/lib/block/blowfish/blowfish.cpp @@ -192,8 +192,12 @@ const uint32_t S_INIT[1024] = { inline uint32_t BFF(uint32_t X, const secure_vector& S) { - return ((S[ get_byte(0, X)] + S[256+get_byte(1, X)]) ^ - S[512+get_byte(2, X)]) + S[768+get_byte(3, X)]; + const uint32_t s0 = S[get_byte(0, X)]; + const uint32_t s1 = S[get_byte(1, X) + 256]; + const uint32_t s2 = S[get_byte(2, X) + 512]; + const uint32_t s3 = S[get_byte(3, X) + 768]; + + return (((s0 + s1) ^ s2) + s3); } } -- cgit v1.2.3