From d7c36115d6ed031ea4eccfbd69081d60b153f227 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 3 May 2025 08:39:33 +0000 Subject: CTASSERT that internal pub/priv keys match the sizes exposed in mlkem.h This will need reworking (especially deduplicating) anyway, but it doesn't hurt now. From Kenjiro Nakayama --- src/lib/libcrypto/mlkem/mlkem1024.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/mlkem/mlkem1024.c') diff --git a/src/lib/libcrypto/mlkem/mlkem1024.c b/src/lib/libcrypto/mlkem/mlkem1024.c index f6fccdf6a8..ce6f26e66c 100644 --- a/src/lib/libcrypto/mlkem/mlkem1024.c +++ b/src/lib/libcrypto/mlkem/mlkem1024.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mlkem1024.c,v 1.6 2025/01/03 08:19:24 tb Exp $ */ +/* $OpenBSD: mlkem1024.c,v 1.7 2025/05/03 08:39:33 tb Exp $ */ /* * Copyright (c) 2024, Google Inc. * Copyright (c) 2024, Bob Beck @@ -793,6 +793,8 @@ struct public_key { matrix m; }; +CTASSERT(sizeof(struct MLKEM1024_public_key) == sizeof(struct public_key)); + static struct public_key * public_key_1024_from_external(const struct MLKEM1024_public_key *external) { @@ -805,6 +807,8 @@ struct private_key { uint8_t fo_failure_secret[32]; }; +CTASSERT(sizeof(struct MLKEM1024_private_key) == sizeof(struct private_key)); + static struct private_key * private_key_1024_from_external(const struct MLKEM1024_private_key *external) { -- cgit v1.2.3-55-g6feb