From f57a491b5e54ccb94d628786f90482a1b68e2cb0 Mon Sep 17 00:00:00 2001
From: Charles Wright <cvwright@futo.org>
Date: Mon, 7 Feb 2022 13:14:35 -0600
Subject: [PATCH] Make PHF minimum params specific to Argon2

---
 bsspeke.c | 8 ++++----
 bsspeke.h | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/bsspeke.c b/bsspeke.c
index 5ec4e50..2a35613 100644
--- a/bsspeke.c
+++ b/bsspeke.c
@@ -196,10 +196,10 @@ bsspeke_client_setup_generate_message3
     )
 {
     // Sanity checks first, before we do any work
-    if( phf_blocks < BSSPEKE_MIN_PHF_BLOCKS ) {
+    if( phf_blocks < BSSPEKE_ARGON2_MIN_PHF_BLOCKS ) {
         return -1;
     }
-    if( phf_iterations < BSSPEKE_MIN_PHF_ITERATIONS ) {
+    if( phf_iterations < BSSPEKE_ARGON2_MIN_PHF_ITERATIONS ) {
         return -1;
     }
 
@@ -355,11 +355,11 @@ bsspeke_client_login_generate_message3(bsspeke_login_msg3_t *msg3,
                                  bsspeke_client_ctx *client
 ) {
     // Sanity checks first, before we do any work
-    if( msg2->phf_blocks < BSSPEKE_MIN_PHF_BLOCKS ) {
+    if( msg2->phf_blocks < BSSPEKE_ARGON2_MIN_PHF_BLOCKS ) {
         debug(ERROR, "phf_blocks is too low.  Aborting.");
         return -1;
     }
-    if( msg2->phf_iterations < BSSPEKE_MIN_PHF_ITERATIONS ) {
+    if( msg2->phf_iterations < BSSPEKE_ARGON2_MIN_PHF_ITERATIONS ) {
         debug(ERROR, "phf_iterations is too low.  Aborting.");
         return -1;
     }
diff --git a/bsspeke.h b/bsspeke.h
index 0d1baac..099c8e7 100644
--- a/bsspeke.h
+++ b/bsspeke.h
@@ -31,8 +31,8 @@ extern "C" {
 #define BSSPEKE_VERIFY_SERVER_MODIFIER "server"
 #define BSSPEKE_VERIFY_SERVER_MODIFIER_LEN 6
 
-#define BSSPEKE_MIN_PHF_BLOCKS 100000
-#define BSSPEKE_MIN_PHF_ITERATIONS 3
+#define BSSPEKE_ARGON2_MIN_PHF_BLOCKS 100000
+#define BSSPEKE_ARGON2_MIN_PHF_ITERATIONS 3
 
 typedef struct {
     // Login credentials
-- 
GitLab