aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pbkdf/argon2
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/pbkdf/argon2')
-rw-r--r--src/lib/pbkdf/argon2/argon2.h2
-rw-r--r--src/lib/pbkdf/argon2/argon2fmt.cpp4
-rw-r--r--src/lib/pbkdf/argon2/argon2pwhash.cpp4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/pbkdf/argon2/argon2.h b/src/lib/pbkdf/argon2/argon2.h
index 15bda45cc..a6fa03314 100644
--- a/src/lib/pbkdf/argon2/argon2.h
+++ b/src/lib/pbkdf/argon2/argon2.h
@@ -95,7 +95,7 @@ std::string BOTAN_PUBLIC_API(2,11)
argon2_generate_pwhash(const char* password, size_t password_len,
RandomNumberGenerator& rng,
size_t p, size_t M, size_t t,
- size_t y = 2, size_t salt_len = 16, size_t output_len = 32);
+ uint8_t y = 2, size_t salt_len = 16, size_t output_len = 32);
/**
* Check a previously created password hash
diff --git a/src/lib/pbkdf/argon2/argon2fmt.cpp b/src/lib/pbkdf/argon2/argon2fmt.cpp
index f64cd2bbd..480be5fa3 100644
--- a/src/lib/pbkdf/argon2/argon2fmt.cpp
+++ b/src/lib/pbkdf/argon2/argon2fmt.cpp
@@ -26,7 +26,7 @@ std::string strip_padding(std::string s)
std::string argon2_generate_pwhash(const char* password, size_t password_len,
RandomNumberGenerator& rng,
size_t p, size_t M, size_t t,
- size_t y, size_t salt_len, size_t output_len)
+ uint8_t y, size_t salt_len, size_t output_len)
{
std::vector<uint8_t> salt(salt_len);
rng.randomize(salt.data(), salt.size());
@@ -62,7 +62,7 @@ bool argon2_check_pwhash(const char* password, size_t password_len,
if(parts.size() != 5)
return false;
- size_t family = 0;
+ uint8_t family = 0;
if(parts[0] == "argon2d")
family = 0;
diff --git a/src/lib/pbkdf/argon2/argon2pwhash.cpp b/src/lib/pbkdf/argon2/argon2pwhash.cpp
index 25788c0bb..4eb2570f6 100644
--- a/src/lib/pbkdf/argon2/argon2pwhash.cpp
+++ b/src/lib/pbkdf/argon2/argon2pwhash.cpp
@@ -115,14 +115,14 @@ std::unique_ptr<PasswordHash> Argon2_Family::tune(size_t /*output_length*/,
const uint64_t mem_headroom = max_kib / M;
const uint64_t M_mult = std::min(desired_cost_increase, mem_headroom);
- M *= M_mult;
+ M *= static_cast<size_t>(M_mult);
est_nsec *= M_mult;
}
if(est_nsec < target_nsec)
{
const uint64_t desired_cost_increase = (target_nsec + est_nsec - 1) / est_nsec;
- t *= desired_cost_increase;
+ t *= static_cast<size_t>(desired_cost_increase);
}
return this->from_params(M, t, p);