aboutsummaryrefslogtreecommitdiffstats
path: root/src/kdf/kdf2
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-10-12 16:23:03 +0000
committerlloyd <[email protected]>2010-10-12 16:23:03 +0000
commite3e02712563e03fbfd6b474cfaa7c0dfdf08f267 (patch)
tree2d5049051b774cd902b6658781543ce4dc9834fe /src/kdf/kdf2
parent4a6fd8c70d40f88c8b51127bfa055b66b18e0f7a (diff)
s/u32bit/size_t/ in kdf
Diffstat (limited to 'src/kdf/kdf2')
-rw-r--r--src/kdf/kdf2/kdf2.cpp12
-rw-r--r--src/kdf/kdf2/kdf2.h4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/kdf/kdf2/kdf2.cpp b/src/kdf/kdf2/kdf2.cpp
index 14cc29a31..b10077e35 100644
--- a/src/kdf/kdf2/kdf2.cpp
+++ b/src/kdf/kdf2/kdf2.cpp
@@ -13,9 +13,9 @@ namespace Botan {
/*
* KDF2 Key Derivation Mechanism
*/
-SecureVector<byte> KDF2::derive(u32bit out_len,
- const byte secret[], u32bit secret_len,
- const byte P[], u32bit P_len) const
+SecureVector<byte> KDF2::derive(size_t out_len,
+ const byte secret[], size_t secret_len,
+ const byte P[], size_t P_len) const
{
SecureVector<byte> output;
u32bit counter = 1;
@@ -23,12 +23,12 @@ SecureVector<byte> KDF2::derive(u32bit out_len,
while(out_len && counter)
{
hash->update(secret, secret_len);
- for(u32bit j = 0; j != 4; ++j)
- hash->update(get_byte(j, counter));
+ for(size_t i = 0; i != 4; ++i)
+ hash->update(get_byte(i, counter));
hash->update(P, P_len);
SecureVector<byte> hash_result = hash->final();
- u32bit added = std::min<u32bit>(hash_result.size(), out_len);
+ size_t added = std::min(hash_result.size(), out_len);
output += std::make_pair(&hash_result[0], added);
out_len -= added;
diff --git a/src/kdf/kdf2/kdf2.h b/src/kdf/kdf2/kdf2.h
index 1f01008c0..f2fd7630d 100644
--- a/src/kdf/kdf2/kdf2.h
+++ b/src/kdf/kdf2/kdf2.h
@@ -19,8 +19,8 @@ namespace Botan {
class BOTAN_DLL KDF2 : public KDF
{
public:
- SecureVector<byte> derive(u32bit, const byte[], u32bit,
- const byte[], u32bit) const;
+ SecureVector<byte> derive(size_t, const byte[], size_t,
+ const byte[], size_t) const;
KDF2(HashFunction* h) : hash(h) {}
KDF2(const KDF2& other) : KDF(), hash(other.hash->clone()) {}