diff options
Diffstat (limited to 'src/kdf/kdf2')
-rw-r--r-- | src/kdf/kdf2/kdf2.cpp | 12 | ||||
-rw-r--r-- | src/kdf/kdf2/kdf2.h | 4 |
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()) {} |