diff options
author | Daniel Neus <[email protected]> | 2016-01-09 12:37:13 +0100 |
---|---|---|
committer | Daniel Neus <[email protected]> | 2016-01-09 12:37:13 +0100 |
commit | f391635f202cf6f83539bd69688975a30f5f874f (patch) | |
tree | 206459e94ab379ba18a8e8035b1855327aa02126 /src/lib/block/kasumi | |
parent | 52afcc69d97621e5a3880798d7814a474e71c03b (diff) | |
parent | 791b3dc9947a94d35e6d54b274b0512fb0ebd09c (diff) |
Merge remote-tracking branch 'remotes/github/master' into noreturn
# Conflicts:
# src/build-data/cc/gcc.txt
Diffstat (limited to 'src/lib/block/kasumi')
-rw-r--r-- | src/lib/block/kasumi/kasumi.cpp | 24 | ||||
-rw-r--r-- | src/lib/block/kasumi/kasumi.h | 2 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/block/kasumi/kasumi.cpp b/src/lib/block/kasumi/kasumi.cpp index 604d2d21a..014987bc6 100644 --- a/src/lib/block/kasumi/kasumi.cpp +++ b/src/lib/block/kasumi/kasumi.cpp @@ -119,7 +119,7 @@ void KASUMI::encrypt_n(const byte in[], byte out[], size_t blocks) const for(size_t j = 0; j != 8; j += 2) { - const u16bit* K = &EK[8*j]; + const u16bit* K = &m_EK[8*j]; u16bit R = B1 ^ (rotate_left(B0, 1) & K[0]); u16bit L = B0 ^ (rotate_left(R, 1) | K[1]); @@ -163,7 +163,7 @@ void KASUMI::decrypt_n(const byte in[], byte out[], size_t blocks) const for(size_t j = 0; j != 8; j += 2) { - const u16bit* K = &EK[8*(6-j)]; + const u16bit* K = &m_EK[8*(6-j)]; u16bit L = B2, R = B3; @@ -210,24 +210,24 @@ void KASUMI::key_schedule(const byte key[], size_t) K[i+8] = K[i] ^ RC[i]; } - EK.resize(64); + m_EK.resize(64); for(size_t i = 0; i != 8; ++i) { - EK[8*i ] = rotate_left(K[(i+0) % 8 ], 2); - EK[8*i+1] = rotate_left(K[(i+2) % 8 + 8], 1); - EK[8*i+2] = rotate_left(K[(i+1) % 8 ], 5); - EK[8*i+3] = K[(i+4) % 8 + 8]; - EK[8*i+4] = rotate_left(K[(i+5) % 8 ], 8); - EK[8*i+5] = K[(i+3) % 8 + 8]; - EK[8*i+6] = rotate_left(K[(i+6) % 8 ], 13); - EK[8*i+7] = K[(i+7) % 8 + 8]; + m_EK[8*i ] = rotate_left(K[(i+0) % 8 ], 2); + m_EK[8*i+1] = rotate_left(K[(i+2) % 8 + 8], 1); + m_EK[8*i+2] = rotate_left(K[(i+1) % 8 ], 5); + m_EK[8*i+3] = K[(i+4) % 8 + 8]; + m_EK[8*i+4] = rotate_left(K[(i+5) % 8 ], 8); + m_EK[8*i+5] = K[(i+3) % 8 + 8]; + m_EK[8*i+6] = rotate_left(K[(i+6) % 8 ], 13); + m_EK[8*i+7] = K[(i+7) % 8 + 8]; } } void KASUMI::clear() { - zap(EK); + zap(m_EK); } } diff --git a/src/lib/block/kasumi/kasumi.h b/src/lib/block/kasumi/kasumi.h index 9f86279af..83b936766 100644 --- a/src/lib/block/kasumi/kasumi.h +++ b/src/lib/block/kasumi/kasumi.h @@ -27,7 +27,7 @@ class BOTAN_DLL KASUMI : public Block_Cipher_Fixed_Params<8, 16> private: void key_schedule(const byte[], size_t) override; - secure_vector<u16bit> EK; + secure_vector<u16bit> m_EK; }; } |