diff options
author | Jack Lloyd <[email protected]> | 2020-11-30 05:58:34 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2020-11-30 05:58:34 -0500 |
commit | 669dcdb42908337afa2a19cfc532aa17716beec7 (patch) | |
tree | 3e22b62814bf51de0140883f8c102a29329720d2 /src/lib/block/blowfish | |
parent | 83c949da05605229aa1a917229c1e67b1edc529c (diff) |
Break complicated expression down into several statements
Diffstat (limited to 'src/lib/block/blowfish')
-rw-r--r-- | src/lib/block/blowfish/blowfish.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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<uint32_t>& 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); } } |