aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/lubyrack/lubyrack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/block/lubyrack/lubyrack.cpp')
-rw-r--r--src/block/lubyrack/lubyrack.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/block/lubyrack/lubyrack.cpp b/src/block/lubyrack/lubyrack.cpp
index ef4a11e9d..77f2a7542 100644
--- a/src/block/lubyrack/lubyrack.cpp
+++ b/src/block/lubyrack/lubyrack.cpp
@@ -17,7 +17,7 @@ void LubyRackoff::encrypt_n(const byte in[], byte out[], size_t blocks) const
{
const size_t len = hash->output_length();
- SecureVector<byte> buffer_vec(len);
+ secure_vector<byte> buffer_vec(len);
byte* buffer = &buffer_vec[0];
for(size_t i = 0; i != blocks; ++i)
@@ -54,7 +54,7 @@ void LubyRackoff::decrypt_n(const byte in[], byte out[], size_t blocks) const
{
const size_t len = hash->output_length();
- SecureVector<byte> buffer_vec(len);
+ secure_vector<byte> buffer_vec(len);
byte* buffer = &buffer_vec[0];
for(size_t i = 0; i != blocks; ++i)
@@ -89,10 +89,8 @@ void LubyRackoff::decrypt_n(const byte in[], byte out[], size_t blocks) const
*/
void LubyRackoff::key_schedule(const byte key[], size_t length)
{
- K1.resize(length / 2);
- K2.resize(length / 2);
- copy_mem(&K1[0], key , length / 2);
- copy_mem(&K2[0], key + length / 2, length / 2);
+ K1.assign(key, key + (length / 2));
+ K2.assign(key + (length / 2), key + length);
}
/*
@@ -100,8 +98,8 @@ void LubyRackoff::key_schedule(const byte key[], size_t length)
*/
void LubyRackoff::clear()
{
- zeroise(K1);
- zeroise(K2);
+ K1.clear();
+ K2.clear();
hash->clear();
}