From ade3b319a92ab3a8c8efeba5bf95da9e87d0f86c Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Fri, 28 Jul 2017 01:34:53 -0400 Subject: [PATCH] Assign t and v together in Sosemanuk (Issue 449) This saved about 0.1 cpb, and increased throughput to 1536 MiB/s --- sosemanuk.cpp | 7 +++---- 1 file 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 {