From bc182cf8ba4a27fd401f82b68dc15d9af4816c9f Mon Sep 17 00:00:00 2001 From: Loganaden Velvindron Date: Mon, 13 Jan 2025 13:38:40 +0000 Subject: [PATCH] Minor fixes as suggested by Matt Johnston. Signed-off-by: Loganaden Velvindron Signed-off-by: Jaykishan Mutkawoa Signed-off-by: Kavish nadan --- src/mlkem768.c | 4 ++-- src/sysoptions.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mlkem768.c b/src/mlkem768.c index 919c94a5..769efa6a 100644 --- a/src/mlkem768.c +++ b/src/mlkem768.c @@ -41,7 +41,7 @@ #include "kex.h" -#ifdef DROPBEAR_MLKEM768 +#if DROPBEAR_MLKEM768 #include "libcrux_mlkem768_sha3.h" #include "mlkem768.h" @@ -51,7 +51,7 @@ int crypto_kem_mlkem768_keypair(unsigned char *pk, unsigned char *sk) { - u_char rnd[LIBCRUX_ML_KEM_KEY_PAIR_PRNG_LEN]; + unsigned char rnd[LIBCRUX_ML_KEM_KEY_PAIR_PRNG_LEN]; struct libcrux_mlkem768_keypair keypair; genrandom(rnd, sizeof(rnd)); diff --git a/src/sysoptions.h b/src/sysoptions.h index 807a0598..296fd32a 100644 --- a/src/sysoptions.h +++ b/src/sysoptions.h @@ -208,7 +208,7 @@ #define DROPBEAR_SK_ED25519 ((DROPBEAR_SK_KEYS) && (DROPBEAR_ED25519)) #endif -#define DROPBEAR_PQHYBRID DROPBEAR_SNTRUP761 || DROPBEAR_MLKEM768 +#define DROPBEAR_PQHYBRID (DROPBEAR_SNTRUP761 || DROPBEAR_MLKEM768) #define DROPBEAR_CURVE25519_DEP (DROPBEAR_CURVE25519 || DROPBEAR_PQHYBRID) /* Dropbear only uses server-sig-algs, only needed if we have rsa-sha256 pubkey auth */ @@ -261,11 +261,11 @@ #endif /* For kex hash buffer, worst case size for Q_C || Q_S || K */ -#if DROPBEAR_SNTRUP761 +#if DROPBEAR_MLKEM768 +#define MAX_KEX_PARTS (2*4 + 1184 + 1088 + 32*2 + 68) +#elif DROPBEAR_SNTRUP761 /* 2337 */ #define MAX_KEX_PARTS (2*4 + 1158 + 1039 + 32*2 + 68) -#elif DROPBEAR_MLKEM768 -#define MAX_KEX_PARTS (2*4 + 1184 + 1088 + 32*2 + 68) #elif DROPBEAR_DH_GROUP16 /* 4096 bit group */ #define MAX_KEX_PARTS (3 * 520)