diff options
author | lloyd <[email protected]> | 2008-09-17 23:12:53 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-09-17 23:12:53 +0000 |
commit | 119cba52f4e96e18fbad846d1fc8dfe682f38974 (patch) | |
tree | 46127441faf677c51eca9de4ef0889351aac55b1 /include | |
parent | dffdb97af1b2ef5d68c647385190bccdd965b28c (diff) |
Add an optimization suggested by Yves Jerschow to combine the four
Blowfish Sboxes into one 1024 word array and index into them at
offsets. On my x86-64 machine there is no real difference between the
two, but on register constrained processor like x86 it may make a large
difference, since the x86 has a much easier time indexing off a single
address held in a register rather than 4 distinct ones.
Diffstat (limited to 'include')
-rw-r--r-- | include/blowfish.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/blowfish.h b/include/blowfish.h index b331e7baa..79875ba90 100644 --- a/include/blowfish.h +++ b/include/blowfish.h @@ -1,6 +1,6 @@ /************************************************* * Blowfish Header File * -* (C) 1999-2007 Jack Lloyd * +* (C) 1999-2008 Jack Lloyd * *************************************************/ #ifndef BOTAN_BLOWFISH_H__ @@ -26,10 +26,10 @@ class BOTAN_DLL Blowfish : public BlockCipher void key(const byte[], u32bit); void generate_sbox(u32bit[], u32bit, u32bit&, u32bit&) const; - static const u32bit PBOX[18]; - static const u32bit SBOX[1024]; + static const u32bit P_INIT[18]; + static const u32bit S_INIT[1024]; - SecureBuffer<u32bit, 256> S1, S2, S3, S4; + SecureBuffer<u32bit, 1024> S; SecureBuffer<u32bit, 18> P; }; |