From 5ee7aba77670692633f19173068934d1fe35b632 Mon Sep 17 00:00:00 2001 From: Anjan Roy Date: Mon, 2 Sep 2024 22:58:47 +0400 Subject: [PATCH] Do not cast to const type, when not required Signed-off-by: Anjan Roy --- include/ml_kem/internals/ml_kem.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/ml_kem/internals/ml_kem.hpp b/include/ml_kem/internals/ml_kem.hpp index 9e99752..6e26031 100644 --- a/include/ml_kem/internals/ml_kem.hpp +++ b/include/ml_kem/internals/ml_kem.hpp @@ -148,9 +148,8 @@ decapsulate(std::span se (void)k_pke::encrypt(pubkey, g_in_span0, g_out_span1, c_prime); // line 9-12 of algorithm 17, in constant-time - using kdf_t = std::span; const uint32_t cond = ml_kem_utils::ct_memcmp(cipher, std::span(c_prime)); - ml_kem_utils::ct_cond_memcpy(cond, shared_secret, kdf_t(g_out_span0), kdf_t(z)); + ml_kem_utils::ct_cond_memcpy(cond, shared_secret, std::span(g_out_span0), z); } }