From f1223709e193c4513047293a1a42b55b9e8874b8 Mon Sep 17 00:00:00 2001 From: Claudius 'keldu' Holeksa Date: Thu, 18 Jul 2024 15:47:29 +0200 Subject: Added argon2i as hashing alg with one test --- modules/crypto/c++/hash.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/crypto/c++') 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("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("Failed to hash"); } -- cgit v1.2.3