summaryrefslogtreecommitdiff
path: root/modules/crypto/c++
diff options
context:
space:
mode:
authorClaudius 'keldu' Holeksa <mail@keldu.de>2024-07-18 15:47:29 +0200
committerClaudius 'keldu' Holeksa <mail@keldu.de>2024-07-18 15:47:29 +0200
commitf1223709e193c4513047293a1a42b55b9e8874b8 (patch)
tree874e76039ec3885e1448d69f14abd42763f4ba7b /modules/crypto/c++
parente732c6efd96a22296591f3becc1c63fc80299938 (diff)
Added argon2i as hashing alg with one test
Diffstat (limited to 'modules/crypto/c++')
-rw-r--r--modules/crypto/c++/hash.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/crypto/c++/hash.hpp b/modules/crypto/c++/hash.hpp
index 5898adc..8e8ca86 100644
--- a/modules/crypto/c++/hash.hpp
+++ b/modules/crypto/c++/hash.hpp
@@ -20,7 +20,7 @@ public:
uint32_t t_cost = 2;
uint32_t m_cost = 1<<16;
uint32_t parallel = 1;
- char* salt_c_ptr = nullptr;
+ const char* salt_c_ptr = nullptr;
if(salt.size() > 0){
salt_c_ptr = &salt.at(0);
}
@@ -30,8 +30,8 @@ public:
}catch(const std::exception&){
return make_error<err::out_of_memory>("Couldn't allocate hash string");
}
- int rv = argon2i_hash_raw(t_cost, m_cost, parallel, &input.at(0), input.size(), &salt.at(0), salt.size(), &hash.at(0), hash.size());
- if(rc != ARGON2_OK){
+ int rv = argon2i_hash_raw(t_cost, m_cost, parallel, &input.at(0), input.size(), salt_c_ptr, salt.size(), &hash.at(0), hash.size());
+ if(rv != ARGON2_OK){
return make_error<err::invalid_state>("Failed to hash");
}