aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pbkdf/argon2
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-06-14 10:52:40 -0400
committerJack Lloyd <[email protected]>2019-06-14 10:52:40 -0400
commited65dcf5d0f8f0cb4a5ec2c74653d4737aaa7c38 (patch)
treebce8bf4a35553ac6198f56d6daba1462048157a5 /src/lib/pbkdf/argon2
parent1e160e460357d318326733007c7aeb015e333651 (diff)
Resolve some MSVC warnings
Diffstat (limited to 'src/lib/pbkdf/argon2')
-rw-r--r--src/lib/pbkdf/argon2/argon2.h2
-rw-r--r--src/lib/pbkdf/argon2/argon2pwhash.cpp10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/pbkdf/argon2/argon2.h b/src/lib/pbkdf/argon2/argon2.h
index e0fe1d83d..e17456676 100644
--- a/src/lib/pbkdf/argon2/argon2.h
+++ b/src/lib/pbkdf/argon2/argon2.h
@@ -28,7 +28,7 @@ class BOTAN_PUBLIC_API(2,11) Argon2 final : public PasswordHash
* Derive a new key under the current Argon2 parameter set
*/
void derive_key(uint8_t out[], size_t out_len,
- const char* password, const size_t password_len,
+ const char* password, size_t password_len,
const uint8_t salt[], size_t salt_len) const override;
std::string to_string() const override;
diff --git a/src/lib/pbkdf/argon2/argon2pwhash.cpp b/src/lib/pbkdf/argon2/argon2pwhash.cpp
index 5af3c709b..25788c0bb 100644
--- a/src/lib/pbkdf/argon2/argon2pwhash.cpp
+++ b/src/lib/pbkdf/argon2/argon2pwhash.cpp
@@ -19,7 +19,7 @@ Argon2::Argon2(uint8_t family, size_t M, size_t t, size_t p) :
{}
void Argon2::derive_key(uint8_t output[], size_t output_len,
- const char* password, const size_t password_len,
+ const char* password, size_t password_len,
const uint8_t salt[], size_t salt_len) const
{
argon2(output, output_len,
@@ -111,17 +111,17 @@ std::unique_ptr<PasswordHash> Argon2_Family::tune(size_t /*output_length*/,
if(est_nsec < target_nsec && M < max_kib)
{
- const size_t desired_cost_increase = (target_nsec + est_nsec - 1) / est_nsec;
- const size_t mem_headroom = max_kib / M;
+ const uint64_t desired_cost_increase = (target_nsec + est_nsec - 1) / est_nsec;
+ const uint64_t mem_headroom = max_kib / M;
- const size_t M_mult = std::min(desired_cost_increase, mem_headroom);
+ const uint64_t M_mult = std::min(desired_cost_increase, mem_headroom);
M *= M_mult;
est_nsec *= M_mult;
}
if(est_nsec < target_nsec)
{
- const size_t desired_cost_increase = (target_nsec + est_nsec - 1) / est_nsec;
+ const uint64_t desired_cost_increase = (target_nsec + est_nsec - 1) / est_nsec;
t *= desired_cost_increase;
}