aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/kasumi
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-05-25 22:52:00 +0000
committerlloyd <[email protected]>2012-05-25 22:52:00 +0000
commit12090a7148d9ee73572cc1a7268fc489504a8173 (patch)
tree51e50ce0852c56231e9e6dc13f168b10edd45d01 /src/block/kasumi
parent9594979caf775dc4062850044715b804d1fda60c (diff)
parent65cc04445f8d40497f02a14bd8cb97081790e54b (diff)
propagate from branch 'net.randombit.botan.x509-path-validation' (head 63b5a20eab129ca13287fda33d2d02eec329708f)
to branch 'net.randombit.botan' (head 8b8150f09c55184f028f2929c4e7f7cd0d46d96e)
Diffstat (limited to 'src/block/kasumi')
-rw-r--r--src/block/kasumi/kasumi.cpp4
-rw-r--r--src/block/kasumi/kasumi.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/block/kasumi/kasumi.cpp b/src/block/kasumi/kasumi.cpp
index a57c0396a..ae21338c6 100644
--- a/src/block/kasumi/kasumi.cpp
+++ b/src/block/kasumi/kasumi.cpp
@@ -204,13 +204,15 @@ void KASUMI::key_schedule(const byte key[], size_t)
static const u16bit RC[] = { 0x0123, 0x4567, 0x89AB, 0xCDEF,
0xFEDC, 0xBA98, 0x7654, 0x3210 };
- SecureVector<u16bit> K(16);
+ secure_vector<u16bit> K(16);
for(size_t i = 0; i != 8; ++i)
{
K[i] = load_be<u16bit>(key, i);
K[i+8] = K[i] ^ RC[i];
}
+ EK.resize(64);
+
for(size_t i = 0; i != 8; ++i)
{
EK[8*i ] = rotate_left(K[(i+0) % 8 ], 2);
diff --git a/src/block/kasumi/kasumi.h b/src/block/kasumi/kasumi.h
index 7871aa170..571085612 100644
--- a/src/block/kasumi/kasumi.h
+++ b/src/block/kasumi/kasumi.h
@@ -21,15 +21,13 @@ class BOTAN_DLL KASUMI : public Block_Cipher_Fixed_Params<8, 16>
void encrypt_n(const byte in[], byte out[], size_t blocks) const;
void decrypt_n(const byte in[], byte out[], size_t blocks) const;
- void clear() { zeroise(EK); }
+ void clear() { EK.clear(); }
std::string name() const { return "KASUMI"; }
BlockCipher* clone() const { return new KASUMI; }
-
- KASUMI() : EK(64) {}
private:
void key_schedule(const byte[], size_t);
- SecureVector<u16bit> EK;
+ secure_vector<u16bit> EK;
};
}