aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/block/serpent/serpent.h2
-rw-r--r--src/block/serpent_x86_32/serp_x86_32.cpp12
-rw-r--r--src/hash/md4_x86_32/md4_x86_32.cpp2
-rw-r--r--src/hash/md5_x86_32/md5_x86_32.cpp2
4 files changed, 11 insertions, 7 deletions
diff --git a/src/block/serpent/serpent.h b/src/block/serpent/serpent.h
index 9e5abcf35..9266ccef8 100644
--- a/src/block/serpent/serpent.h
+++ b/src/block/serpent/serpent.h
@@ -38,7 +38,7 @@ class BOTAN_DLL Serpent : public Block_Cipher_Fixed_Params<16, 16, 32, 8>
*/
void set_round_keys(const u32bit ks[132])
{
- copy_mem(&round_key[0], ks, 132);
+ round_key.assign(&ks[0], &ks[132]);
}
private:
diff --git a/src/block/serpent_x86_32/serp_x86_32.cpp b/src/block/serpent_x86_32/serp_x86_32.cpp
index 9566ed8a6..afff5835c 100644
--- a/src/block/serpent_x86_32/serp_x86_32.cpp
+++ b/src/block/serpent_x86_32/serp_x86_32.cpp
@@ -46,9 +46,11 @@ void botan_serpent_x86_32_key_schedule(u32bit ks[140]);
*/
void Serpent_X86_32::encrypt_n(const byte in[], byte out[], size_t blocks) const
{
+ auto keys = this->get_round_keys();
+
for(size_t i = 0; i != blocks; ++i)
{
- botan_serpent_x86_32_encrypt(in, out, this->get_round_keys());
+ botan_serpent_x86_32_encrypt(in, out, &keys[0]);
in += BLOCK_SIZE;
out += BLOCK_SIZE;
}
@@ -59,9 +61,11 @@ void Serpent_X86_32::encrypt_n(const byte in[], byte out[], size_t blocks) const
*/
void Serpent_X86_32::decrypt_n(const byte in[], byte out[], size_t blocks) const
{
+ auto keys = this->get_round_keys();
+
for(size_t i = 0; i != blocks; ++i)
{
- botan_serpent_x86_32_decrypt(in, out, this->get_round_keys());
+ botan_serpent_x86_32_decrypt(in, out, &keys[0]);
in += BLOCK_SIZE;
out += BLOCK_SIZE;
}
@@ -77,8 +81,8 @@ void Serpent_X86_32::key_schedule(const byte key[], size_t length)
W[i] = load_le<u32bit>(key, i);
W[length / 4] |= u32bit(1) << ((length%4)*8);
- botan_serpent_x86_32_key_schedule(W);
- this->set_round_keys(W + 8);
+ botan_serpent_x86_32_key_schedule(&W[0]);
+ this->set_round_keys(&W[8]);
}
}
diff --git a/src/hash/md4_x86_32/md4_x86_32.cpp b/src/hash/md4_x86_32/md4_x86_32.cpp
index 750e65a95..ed3f72fc9 100644
--- a/src/hash/md4_x86_32/md4_x86_32.cpp
+++ b/src/hash/md4_x86_32/md4_x86_32.cpp
@@ -26,7 +26,7 @@ void MD4_X86_32::compress_n(const byte input[], size_t blocks)
{
for(size_t i = 0; i != blocks; ++i)
{
- botan_md4_x86_32_compress(digest, input, M);
+ botan_md4_x86_32_compress(&digest[0], input, &M[0]);
input += hash_block_size();
}
}
diff --git a/src/hash/md5_x86_32/md5_x86_32.cpp b/src/hash/md5_x86_32/md5_x86_32.cpp
index 123fcff77..73071ac18 100644
--- a/src/hash/md5_x86_32/md5_x86_32.cpp
+++ b/src/hash/md5_x86_32/md5_x86_32.cpp
@@ -23,7 +23,7 @@ void MD5_X86_32::compress_n(const byte input[], size_t blocks)
{
for(size_t i = 0; i != blocks; ++i)
{
- botan_md5_x86_32_compress(digest, input, M);
+ botan_md5_x86_32_compress(&digest[0], input, &M[0]);
input += hash_block_size();
}
}