From 1f65eb8efc7583b399df3ebed9288eb72f41b4c4 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 5 Sep 2024 12:47:03 +0100 Subject: [PATCH] Fix needlessly separating threads and lanes in the argon2 module. We were not using these correctly and Argon2 uses the thread count as the lane count anyway so its pointless to even have a setting for this. --- docs/conf/modules.example.conf | 1 - src/modules/extra/m_argon2.cpp | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/conf/modules.example.conf b/docs/conf/modules.example.conf index b59f1291c..6483793f4 100644 --- a/docs/conf/modules.example.conf +++ b/docs/conf/modules.example.conf @@ -169,7 +169,6 @@ # # memory: Memory hardness, in KiB. E.g. 131072 KiB = 128 MiB. # iterations: Time hardness in iterations. (def. 3) -# lanes: How many parallel chains can be run. (def. 1) # threads: Maximum amount of threads each invocation can spawn. (def. 1) # length: Output length in bytes. (def. 32) # saltlength: Salt length in bytes. (def. 16) diff --git a/src/modules/extra/m_argon2.cpp b/src/modules/extra/m_argon2.cpp index 999bd7d82..e402eaea7 100644 --- a/src/modules/extra/m_argon2.cpp +++ b/src/modules/extra/m_argon2.cpp @@ -35,7 +35,6 @@ class ProviderConfig final { public: uint32_t iterations; - uint32_t lanes; uint32_t memory; uint32_t outlen; uint32_t saltlen; @@ -53,9 +52,6 @@ public: uint32_t def_iterations = def ? def->iterations : 3; this->iterations = tag->getNum("iterations", def_iterations, 1); - uint32_t def_lanes = def ? def->lanes : 1; - this->lanes = tag->getNum("lanes", def_lanes, ARGON2_MIN_LANES, ARGON2_MAX_LANES); - uint32_t def_memory = def ? def->memory : 131072; // 128 MiB this->memory = tag->getNum("memory", def_memory, ARGON2_MIN_MEMORY, ARGON2_MAX_MEMORY); @@ -98,7 +94,7 @@ public: size_t encodedLen = argon2_encodedlen( config.iterations, config.memory, - config.lanes, + config.threads, config.saltlen, config.outlen, argon2Type);