diff options
author | René Korthaus <[email protected]> | 2015-12-23 11:52:19 +0100 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-01-08 19:09:51 -0500 |
commit | d22bc10cd4f67924acd82bcd46a31e3de3b20ce3 (patch) | |
tree | 58459585e6675cd799b6ef5900be026825cd6f9d /src/lib/hash/md4 | |
parent | 2fbfdd7e5afb5e888fd8c0b56c6df09e2bdeaca7 (diff) |
Mass-prefix member vars with m_
Diffstat (limited to 'src/lib/hash/md4')
-rw-r--r-- | src/lib/hash/md4/md4.cpp | 80 | ||||
-rw-r--r-- | src/lib/hash/md4/md4.h | 6 |
2 files changed, 43 insertions, 43 deletions
diff --git a/src/lib/hash/md4/md4.cpp b/src/lib/hash/md4/md4.cpp index 6f4503ac0..d22f2d1ac 100644 --- a/src/lib/hash/md4/md4.cpp +++ b/src/lib/hash/md4/md4.cpp @@ -45,43 +45,43 @@ inline void HH(u32bit& A, u32bit B, u32bit C, u32bit D, u32bit M, byte S) */ void MD4::compress_n(const byte input[], size_t blocks) { - u32bit A = digest[0], B = digest[1], C = digest[2], D = digest[3]; + u32bit A = m_digest[0], B = m_digest[1], C = m_digest[2], D = m_digest[3]; for(size_t i = 0; i != blocks; ++i) { - load_le(M.data(), input, M.size()); - - FF(A,B,C,D,M[ 0], 3); FF(D,A,B,C,M[ 1], 7); - FF(C,D,A,B,M[ 2],11); FF(B,C,D,A,M[ 3],19); - FF(A,B,C,D,M[ 4], 3); FF(D,A,B,C,M[ 5], 7); - FF(C,D,A,B,M[ 6],11); FF(B,C,D,A,M[ 7],19); - FF(A,B,C,D,M[ 8], 3); FF(D,A,B,C,M[ 9], 7); - FF(C,D,A,B,M[10],11); FF(B,C,D,A,M[11],19); - FF(A,B,C,D,M[12], 3); FF(D,A,B,C,M[13], 7); - FF(C,D,A,B,M[14],11); FF(B,C,D,A,M[15],19); - - GG(A,B,C,D,M[ 0], 3); GG(D,A,B,C,M[ 4], 5); - GG(C,D,A,B,M[ 8], 9); GG(B,C,D,A,M[12],13); - GG(A,B,C,D,M[ 1], 3); GG(D,A,B,C,M[ 5], 5); - GG(C,D,A,B,M[ 9], 9); GG(B,C,D,A,M[13],13); - GG(A,B,C,D,M[ 2], 3); GG(D,A,B,C,M[ 6], 5); - GG(C,D,A,B,M[10], 9); GG(B,C,D,A,M[14],13); - GG(A,B,C,D,M[ 3], 3); GG(D,A,B,C,M[ 7], 5); - GG(C,D,A,B,M[11], 9); GG(B,C,D,A,M[15],13); - - HH(A,B,C,D,M[ 0], 3); HH(D,A,B,C,M[ 8], 9); - HH(C,D,A,B,M[ 4],11); HH(B,C,D,A,M[12],15); - HH(A,B,C,D,M[ 2], 3); HH(D,A,B,C,M[10], 9); - HH(C,D,A,B,M[ 6],11); HH(B,C,D,A,M[14],15); - HH(A,B,C,D,M[ 1], 3); HH(D,A,B,C,M[ 9], 9); - HH(C,D,A,B,M[ 5],11); HH(B,C,D,A,M[13],15); - HH(A,B,C,D,M[ 3], 3); HH(D,A,B,C,M[11], 9); - HH(C,D,A,B,M[ 7],11); HH(B,C,D,A,M[15],15); - - A = (digest[0] += A); - B = (digest[1] += B); - C = (digest[2] += C); - D = (digest[3] += D); + load_le(m_M.data(), input, m_M.size()); + + FF(A,B,C,D,m_M[ 0], 3); FF(D,A,B,C,m_M[ 1], 7); + FF(C,D,A,B,m_M[ 2],11); FF(B,C,D,A,m_M[ 3],19); + FF(A,B,C,D,m_M[ 4], 3); FF(D,A,B,C,m_M[ 5], 7); + FF(C,D,A,B,m_M[ 6],11); FF(B,C,D,A,m_M[ 7],19); + FF(A,B,C,D,m_M[ 8], 3); FF(D,A,B,C,m_M[ 9], 7); + FF(C,D,A,B,m_M[10],11); FF(B,C,D,A,m_M[11],19); + FF(A,B,C,D,m_M[12], 3); FF(D,A,B,C,m_M[13], 7); + FF(C,D,A,B,m_M[14],11); FF(B,C,D,A,m_M[15],19); + + GG(A,B,C,D,m_M[ 0], 3); GG(D,A,B,C,m_M[ 4], 5); + GG(C,D,A,B,m_M[ 8], 9); GG(B,C,D,A,m_M[12],13); + GG(A,B,C,D,m_M[ 1], 3); GG(D,A,B,C,m_M[ 5], 5); + GG(C,D,A,B,m_M[ 9], 9); GG(B,C,D,A,m_M[13],13); + GG(A,B,C,D,m_M[ 2], 3); GG(D,A,B,C,m_M[ 6], 5); + GG(C,D,A,B,m_M[10], 9); GG(B,C,D,A,m_M[14],13); + GG(A,B,C,D,m_M[ 3], 3); GG(D,A,B,C,m_M[ 7], 5); + GG(C,D,A,B,m_M[11], 9); GG(B,C,D,A,m_M[15],13); + + HH(A,B,C,D,m_M[ 0], 3); HH(D,A,B,C,m_M[ 8], 9); + HH(C,D,A,B,m_M[ 4],11); HH(B,C,D,A,m_M[12],15); + HH(A,B,C,D,m_M[ 2], 3); HH(D,A,B,C,m_M[10], 9); + HH(C,D,A,B,m_M[ 6],11); HH(B,C,D,A,m_M[14],15); + HH(A,B,C,D,m_M[ 1], 3); HH(D,A,B,C,m_M[ 9], 9); + HH(C,D,A,B,m_M[ 5],11); HH(B,C,D,A,m_M[13],15); + HH(A,B,C,D,m_M[ 3], 3); HH(D,A,B,C,m_M[11], 9); + HH(C,D,A,B,m_M[ 7],11); HH(B,C,D,A,m_M[15],15); + + A = (m_digest[0] += A); + B = (m_digest[1] += B); + C = (m_digest[2] += C); + D = (m_digest[3] += D); input += hash_block_size(); } @@ -92,7 +92,7 @@ void MD4::compress_n(const byte input[], size_t blocks) */ void MD4::copy_out(byte output[]) { - copy_out_vec_le(output, output_length(), digest); + copy_out_vec_le(output, output_length(), m_digest); } /* @@ -101,11 +101,11 @@ void MD4::copy_out(byte output[]) void MD4::clear() { MDx_HashFunction::clear(); - zeroise(M); - digest[0] = 0x67452301; - digest[1] = 0xEFCDAB89; - digest[2] = 0x98BADCFE; - digest[3] = 0x10325476; + zeroise(m_M); + m_digest[0] = 0x67452301; + m_digest[1] = 0xEFCDAB89; + m_digest[2] = 0x98BADCFE; + m_digest[3] = 0x10325476; } } diff --git a/src/lib/hash/md4/md4.h b/src/lib/hash/md4/md4.h index 182da4ab2..a0e481773 100644 --- a/src/lib/hash/md4/md4.h +++ b/src/lib/hash/md4/md4.h @@ -24,7 +24,7 @@ class BOTAN_DLL MD4 : public MDx_HashFunction void clear() override; - MD4() : MDx_HashFunction(64, false, true), M(16), digest(4) + MD4() : MDx_HashFunction(64, false, true), m_M(16), m_digest(4) { clear(); } protected: void compress_n(const byte input[], size_t blocks) override; @@ -33,12 +33,12 @@ class BOTAN_DLL MD4 : public MDx_HashFunction /** * The message buffer, exposed for use by subclasses (x86 asm) */ - secure_vector<u32bit> M; + secure_vector<u32bit> m_M; /** * The digest value, exposed for use by subclasses (x86 asm) */ - secure_vector<u32bit> digest; + secure_vector<u32bit> m_digest; }; } |