diff options
Diffstat (limited to 'src/block')
-rw-r--r-- | src/block/aes/aes.cpp | 6 | ||||
-rw-r--r-- | src/block/lubyrack/lubyrack.cpp | 6 | ||||
-rw-r--r-- | src/block/serpent/serpent.h | 4 |
3 files changed, 11 insertions, 5 deletions
diff --git a/src/block/aes/aes.cpp b/src/block/aes/aes.cpp index f149a0ac0..b19699dbc 100644 --- a/src/block/aes/aes.cpp +++ b/src/block/aes/aes.cpp @@ -666,8 +666,10 @@ void aes_key_schedule(const byte key[], size_t length, store_be(XEK[i], &MD[4*i]); } - EK.set(&XEK[0], length + 24); - DK.set(&XDK[0], length + 24); + EK.resize(length + 24); + DK.resize(length + 24); + copy_mem(&EK[0], &XEK[0], EK.size()); + copy_mem(&DK[0], &XDK[0], DK.size()); } } diff --git a/src/block/lubyrack/lubyrack.cpp b/src/block/lubyrack/lubyrack.cpp index 731dceb0b..ef4a11e9d 100644 --- a/src/block/lubyrack/lubyrack.cpp +++ b/src/block/lubyrack/lubyrack.cpp @@ -89,8 +89,10 @@ void LubyRackoff::decrypt_n(const byte in[], byte out[], size_t blocks) const */ void LubyRackoff::key_schedule(const byte key[], size_t length) { - K1.set(key, length / 2); - K2.set(key + length / 2, length / 2); + K1.resize(length / 2); + K2.resize(length / 2); + copy_mem(&K1[0], key , length / 2); + copy_mem(&K2[0], key + length / 2, length / 2); } /* diff --git a/src/block/serpent/serpent.h b/src/block/serpent/serpent.h index 33bd747cd..df3f039aa 100644 --- a/src/block/serpent/serpent.h +++ b/src/block/serpent/serpent.h @@ -39,7 +39,9 @@ class BOTAN_DLL Serpent : public Block_Cipher_Fixed_Params<16, 16, 32, 8> * @param ks is the new key schedule value to set */ void set_round_keys(const u32bit ks[132]) - { round_key.set(ks, 132); } + { + copy_mem(&round_key[0], ks, 132); + } private: void key_schedule(const byte key[], size_t length); |