aboutsummaryrefslogtreecommitdiffstats
path: root/src/kdf/kdf.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-05-18 20:32:36 +0000
committerlloyd <[email protected]>2012-05-18 20:32:36 +0000
commitc691561f3198f481c13457433efbccc1c9fcd898 (patch)
treea45ea2c5a30e0cb009fbcb68a61ef39332ff790c /src/kdf/kdf.cpp
parentd76700f01c7ecac5633edf75f8d7408b46c5dbac (diff)
Fairly huge update that replaces the old secmem types with std::vector
using a custom allocator. Currently our allocator just does new/delete with a memset before deletion, and the mmap and mlock allocators have been removed.
Diffstat (limited to 'src/kdf/kdf.cpp')
-rw-r--r--src/kdf/kdf.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/kdf/kdf.cpp b/src/kdf/kdf.cpp
index 6281f753c..88cbd5b99 100644
--- a/src/kdf/kdf.cpp
+++ b/src/kdf/kdf.cpp
@@ -12,8 +12,8 @@ namespace Botan {
/*
* Derive a key
*/
-SecureVector<byte> KDF::derive_key(size_t key_len,
- const MemoryRegion<byte>& secret,
+secure_vector<byte> KDF::derive_key(size_t key_len,
+ const secure_vector<byte>& secret,
const std::string& salt) const
{
return derive_key(key_len, &secret[0], secret.size(),
@@ -24,8 +24,8 @@ SecureVector<byte> KDF::derive_key(size_t key_len,
/*
* Derive a key
*/
-SecureVector<byte> KDF::derive_key(size_t key_len,
- const MemoryRegion<byte>& secret,
+secure_vector<byte> KDF::derive_key(size_t key_len,
+ const secure_vector<byte>& secret,
const byte salt[], size_t salt_len) const
{
return derive_key(key_len, &secret[0], secret.size(),
@@ -35,18 +35,7 @@ SecureVector<byte> KDF::derive_key(size_t key_len,
/*
* Derive a key
*/
-SecureVector<byte> KDF::derive_key(size_t key_len,
- const MemoryRegion<byte>& secret,
- const MemoryRegion<byte>& salt) const
- {
- return derive_key(key_len, &secret[0], secret.size(),
- &salt[0], salt.size());
- }
-
-/*
-* Derive a key
-*/
-SecureVector<byte> KDF::derive_key(size_t key_len,
+secure_vector<byte> KDF::derive_key(size_t key_len,
const byte secret[], size_t secret_len,
const std::string& salt) const
{
@@ -58,7 +47,7 @@ SecureVector<byte> KDF::derive_key(size_t key_len,
/*
* Derive a key
*/
-SecureVector<byte> KDF::derive_key(size_t key_len,
+secure_vector<byte> KDF::derive_key(size_t key_len,
const byte secret[], size_t secret_len,
const byte salt[], size_t salt_len) const
{