aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey
diff options
context:
space:
mode:
Diffstat (limited to 'src/pubkey')
-rw-r--r--src/pubkey/dlies/dlies.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pubkey/dlies/dlies.cpp b/src/pubkey/dlies/dlies.cpp
index 5dd557b6f..f53aa71f9 100644
--- a/src/pubkey/dlies/dlies.cpp
+++ b/src/pubkey/dlies/dlies.cpp
@@ -43,18 +43,18 @@ SecureVector<byte> DLIES_Encryptor::enc(const byte in[], u32bit length,
throw Invalid_State("DLIES: The other key was never set");
SecureVector<byte> out(my_key.size() + length + mac->OUTPUT_LENGTH);
- out.copy(my_key, my_key.size());
+ out.copy(&my_key[0], my_key.size());
out.copy(my_key.size(), in, length);
SecureVector<byte> vz = my_key;
vz.append(ka.derive_key(0, other_key).bits_of());
const u32bit K_LENGTH = length + mac_keylen;
- OctetString K = kdf->derive_key(K_LENGTH, vz, vz.size());
+ OctetString K = kdf->derive_key(K_LENGTH, vz);
if(K.length() != K_LENGTH)
throw Encoding_Error("DLIES: KDF did not provide sufficient output");
- byte* C = out + my_key.size();
+ byte* C = &out[my_key.size()];
xor_buf(C, K.begin() + mac_keylen, length);
mac->set_key(K.begin(), mac_keylen);
@@ -123,7 +123,7 @@ SecureVector<byte> DLIES_Decryptor::dec(const byte msg[], u32bit length) const
vz.append(ka.derive_key(0, v).bits_of());
const u32bit K_LENGTH = C.size() + mac_keylen;
- OctetString K = kdf->derive_key(K_LENGTH, vz, vz.size());
+ OctetString K = kdf->derive_key(K_LENGTH, vz);
if(K.length() != K_LENGTH)
throw Encoding_Error("DLIES: KDF did not provide sufficient output");