diff options
Diffstat (limited to 'src/lib/block/tea/tea.cpp')
-rw-r--r-- | src/lib/block/tea/tea.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/block/tea/tea.cpp b/src/lib/block/tea/tea.cpp index 01f342607..457171e1d 100644 --- a/src/lib/block/tea/tea.cpp +++ b/src/lib/block/tea/tea.cpp @@ -24,8 +24,8 @@ void TEA::encrypt_n(const byte in[], byte out[], size_t blocks) const for(size_t j = 0; j != 32; ++j) { S += 0x9E3779B9; - L += ((R << 4) + K[0]) ^ (R + S) ^ ((R >> 5) + K[1]); - R += ((L << 4) + K[2]) ^ (L + S) ^ ((L >> 5) + K[3]); + L += ((R << 4) + m_K[0]) ^ (R + S) ^ ((R >> 5) + m_K[1]); + R += ((L << 4) + m_K[2]) ^ (L + S) ^ ((L >> 5) + m_K[3]); } store_be(out, L, R); @@ -48,8 +48,8 @@ void TEA::decrypt_n(const byte in[], byte out[], size_t blocks) const u32bit S = 0xC6EF3720; for(size_t j = 0; j != 32; ++j) { - R -= ((L << 4) + K[2]) ^ (L + S) ^ ((L >> 5) + K[3]); - L -= ((R << 4) + K[0]) ^ (R + S) ^ ((R >> 5) + K[1]); + R -= ((L << 4) + m_K[2]) ^ (L + S) ^ ((L >> 5) + m_K[3]); + L -= ((R << 4) + m_K[0]) ^ (R + S) ^ ((R >> 5) + m_K[1]); S -= 0x9E3779B9; } @@ -65,14 +65,14 @@ void TEA::decrypt_n(const byte in[], byte out[], size_t blocks) const */ void TEA::key_schedule(const byte key[], size_t) { - K.resize(4); + m_K.resize(4); for(size_t i = 0; i != 4; ++i) - K[i] = load_be<u32bit>(key, i); + m_K[i] = load_be<u32bit>(key, i); } void TEA::clear() { - zap(K); + zap(m_K); } } |