aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/dlies/dlies.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-09-14 02:27:02 +0000
committerlloyd <[email protected]>2010-09-14 02:27:02 +0000
commitd472ea829a530fd6995293904d4f07a7ef8b5472 (patch)
tree3b1fd3913aa1b223444753cb39e973d5753f3b4b /src/pubkey/dlies/dlies.cpp
parent77a33b0c16880884cc0326e92c0c30d0e8444a91 (diff)
Remove more implicit vector to pointer conversions
Diffstat (limited to 'src/pubkey/dlies/dlies.cpp')
-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");