Skip to content

Commit 5ee7aba

Browse files
committed
Do not cast to const type, when not required
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
1 parent 43aad07 commit 5ee7aba

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

include/ml_kem/internals/ml_kem.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,8 @@ decapsulate(std::span<const uint8_t, ml_kem_utils::get_kem_secret_key_len(k)> se
148148
(void)k_pke::encrypt<k, eta1, eta2, du, dv>(pubkey, g_in_span0, g_out_span1, c_prime);
149149

150150
// line 9-12 of algorithm 17, in constant-time
151-
using kdf_t = std::span<const uint8_t, shared_secret.size()>;
152151
const uint32_t cond = ml_kem_utils::ct_memcmp(cipher, std::span<const uint8_t, ctlen>(c_prime));
153-
ml_kem_utils::ct_cond_memcpy(cond, shared_secret, kdf_t(g_out_span0), kdf_t(z));
152+
ml_kem_utils::ct_cond_memcpy(cond, shared_secret, std::span<const uint8_t, g_out_span0.size()>(g_out_span0), z);
154153
}
155154

156155
}

0 commit comments

Comments
 (0)