From 27d79c87365105d6128afe9eaf8a82383976ed44 Mon Sep 17 00:00:00 2001 From: lloyd Date: Mon, 13 Sep 2010 12:28:27 +0000 Subject: Anywhere where we use MemoryRegion::begin to get access to the raw pointer representation (rather than in an interator context), instead use &buf[0], which works for both MemoryRegion and std::vector --- src/kdf/kdf.cpp | 6 +++--- src/kdf/mgf1/mgf1.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/kdf') diff --git a/src/kdf/kdf.cpp b/src/kdf/kdf.cpp index 4be8475df..86f5f2476 100644 --- a/src/kdf/kdf.cpp +++ b/src/kdf/kdf.cpp @@ -28,7 +28,7 @@ SecureVector KDF::derive_key(u32bit key_len, const MemoryRegion& secret, const byte salt[], u32bit salt_len) const { - return derive_key(key_len, secret.begin(), secret.size(), + return derive_key(key_len, &secret[0], secret.size(), salt, salt_len); } @@ -39,8 +39,8 @@ SecureVector KDF::derive_key(u32bit key_len, const MemoryRegion& secret, const MemoryRegion& salt) const { - return derive_key(key_len, secret.begin(), secret.size(), - salt.begin(), salt.size()); + return derive_key(key_len, &secret[0], secret.size(), + &salt[0], salt.size()); } /* diff --git a/src/kdf/mgf1/mgf1.cpp b/src/kdf/mgf1/mgf1.cpp index 340e87a7c..509a411fa 100644 --- a/src/kdf/mgf1/mgf1.cpp +++ b/src/kdf/mgf1/mgf1.cpp @@ -30,7 +30,7 @@ void MGF1::mask(const byte in[], u32bit in_len, byte out[], SecureVector buffer = hash->final(); u32bit xored = std::min(buffer.size(), out_len); - xor_buf(out, buffer.begin(), xored); + xor_buf(out, &buffer[0], xored); out += xored; out_len -= xored; -- cgit v1.2.3