From 76377f8219a8d96a9163c8d841040308df96e5f6 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 11 Mar 2017 15:55:44 -0500 Subject: [PATCH] Whitespace checkin --- drbg.h | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/drbg.h b/drbg.h index 875074c5..659ac680 100644 --- a/drbg.h +++ b/drbg.h @@ -463,7 +463,7 @@ void Hash_DRBG::Hash_Generate(const byte* additional { carry = m_v[i] + w[j] + carry; m_v[i] = static_cast(carry); - j--; i--; carry >>= 8; + i--; j--; carry >>= 8; } while (i>=0) { @@ -503,27 +503,27 @@ void Hash_DRBG::Hash_Generate(const byte* additional CRYPTOPP_ASSERT(HASH::DIGESTSIZE >= sizeof(m_reseed)); int carry=0, k=sizeof(m_reseed)-1, j=HASH::DIGESTSIZE-1, i=SEEDLENGTH-1; - // Using Integer class slows things down by about 8 cpb. - // Using word128 and word64 benefits the first loop only by about 2 cpb. + // Using Integer class slows things down by about 8 cpb. + // Using word128 and word64 benefits the first loop only by about 2 cpb. #if defined(CRYPTOPP_WORD128_AVAILABLE) - byte* p1 = m_v.begin()+SEEDLENGTH-8; - byte* p2 = m_c.begin()+SEEDLENGTH-8; - byte* p3 = h.begin()+HASH::DIGESTSIZE-8; + byte* p1 = m_v.begin()+SEEDLENGTH-8; + byte* p2 = m_c.begin()+SEEDLENGTH-8; + byte* p3 = h.begin()+HASH::DIGESTSIZE-8; - word64 w1 = GetWord(false, BIG_ENDIAN_ORDER, p1); - word64 w2 = GetWord(false, BIG_ENDIAN_ORDER, p2); - word64 w3 = GetWord(false, BIG_ENDIAN_ORDER, p3); - word64 w4 = m_reseed; + const word64 w1 = GetWord(false, BIG_ENDIAN_ORDER, p1); + const word64 w2 = GetWord(false, BIG_ENDIAN_ORDER, p2); + const word64 w3 = GetWord(false, BIG_ENDIAN_ORDER, p3); + const word64 w4 = m_reseed; - word128 r = static_cast(w1) + w2 + w3 + w4; - PutWord(false, BIG_ENDIAN_ORDER, p1, static_cast(r)); - j -= 8; i -= 8; k=0; carry = static_cast(r >> 64); + word128 r = static_cast(w1) + w2 + w3 + w4; + PutWord(false, BIG_ENDIAN_ORDER, p1, static_cast(r)); + i -= 8; j -= 8; k=0; carry = static_cast(r >> 64); #else while (k>=0) { carry = m_v[i] + m_c[i] + h[j] + GetByte(BIG_ENDIAN_ORDER, m_reseed, k) + carry; m_v[i] = static_cast(carry); - k--; j--; i--; carry >>= 8; + i--; j--; k--; carry >>= 8; } #endif @@ -531,15 +531,14 @@ void Hash_DRBG::Hash_Generate(const byte* additional { carry = m_v[i] + m_c[i] + h[j] + carry; m_v[i] = static_cast(carry); - j--; i--; carry >>= 8; + i--; j--; carry >>= 8; } while (i>=0) { carry = m_v[i] + m_c[i] + carry; m_v[i] = static_cast(carry); - i--; - carry >>= 8; + i--; carry >>= 8; } }