summaryrefslogtreecommitdiff
path: root/sosemanuk.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-07-28 01:34:53 -0400
committerJeffrey Walton <noloader@gmail.com>2017-07-28 01:34:53 -0400
commitade3b319a92ab3a8c8efeba5bf95da9e87d0f86c (patch)
tree5e8bf26d59d7a0dbc41ef4e8e55774bdb35efd4a /sosemanuk.cpp
parented4c345ce86aad98c38fac120569eb9406fbfc37 (diff)
downloadcryptopp-git-ade3b319a92ab3a8c8efeba5bf95da9e87d0f86c.tar.gz
Assign t and v together in Sosemanuk (Issue 449)
This saved about 0.1 cpb, and increased throughput to 1536 MiB/s
Diffstat (limited to 'sosemanuk.cpp')
-rw-r--r--sosemanuk.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/sosemanuk.cpp b/sosemanuk.cpp
index 709ae756..48b78068 100644
--- a/sosemanuk.cpp
+++ b/sosemanuk.cpp
@@ -638,9 +638,8 @@ void SosemanukPolicy::OperateKeystream(KeystreamOperation operation, byte *outpu
#define STEP(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, v, u) \
u = (s##x9 + r2(x0)) ^ r1(x0);\
- v = s##x0;\
- w = s##x0;\
- s##x0 = MUL_A(w) ^ DIV_A(s##x3) ^ s##x9;\
+ t = v = s##x0;\
+ s##x0 = MUL_A(t) ^ DIV_A(s##x3) ^ s##x9;\
r1(x0) += XMUX(r2(x0), s##x2, s##x9);\
r2(x0) = rotlFixed(r2(x0) * 0x54655307, 7);\
@@ -666,7 +665,7 @@ void SosemanukPolicy::OperateKeystream(KeystreamOperation operation, byte *outpu
word32 s9 = m_state[9];
word32 reg1 = m_state[10];
word32 reg2 = m_state[11];
- word32 u0, u1, u2, u3, u4, v0, v1, v2, v3, w;
+ word32 t, u0, u1, u2, u3, u4, v0, v1, v2, v3;
do
{