From df85fb0fd7ca968bd107ea06ced34e5701a0f979 Mon Sep 17 00:00:00 2001 From: Royyan Zahir Date: Sun, 20 Sep 2026 06:38:31 +0400 Subject: [PATCH] crypto: fix chacha constants under GCC 15. GCC 15 added -Wunterminated-string-initialization, and both constants fill their array exactly, leaving no room for the terminator. Every build with that compiler fails, since crypto/Makefile treats warnings as errors. Neither is used as a string: they are read as sixteen bytes through U8TO32_LITTLE(). Letting the array size follow the literal keeps them readable, costs one byte each, and needs no attribute that only some compilers have. The cipher state is unchanged for both key sizes. Signed-off-by: Royyan Zahir --- crypto/chacha_private.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/chacha_private.h b/crypto/chacha_private.h index 5829cfbee66bd..37ea58d270b9d 100644 --- a/crypto/chacha_private.h +++ b/crypto/chacha_private.h @@ -58,8 +58,8 @@ chacha_ctx; } \ while (0) -static const char sigma[16] = "expand 32-byte k"; -static const char tau[16] = "expand 16-byte k"; +static const char sigma[] = "expand 32-byte k"; +static const char tau[] = "expand 16-byte k"; static inline void hchacha20(FAR uint32_t *derived_key, FAR const uint8_t *nonce,