HomeFreeBSD

crypto: avoid warnings about too-long initializer strings

Description

crypto: avoid warnings about too-long initializer strings

Mark sigma and tau as __non_string, to avoid warnings from clang
21 similar to:

sys/crypto/chacha20/chacha.c:53:31: error: initializer-string for character array is too long, array size is 16 but initializer has size 17 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
   53 | static const char sigma[16] = "expand 32-byte k";
      |                               ^~~~~~~~~~~~~~~~~~
sys/crypto/chacha20/chacha.c:54:29: error: initializer-string for character array is too long, array size is 16 but initializer has size 17 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
   54 | static const char tau[16] = "expand 16-byte k";
      |                             ^~~~~~~~~~~~~~~~~~

MFC after: 3 days
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D54364

(cherry picked from commit 710ec409dffed3306ced253bba85dbdc7758510b)

Details

Provenance
dimAuthored on Dec 30 2025, 12:46 PM
Reviewer
markj
Differential Revision
D54364: crypto: avoid warnings about too-long initializer strings
Parents
rGa7805f334170: ncurses: avoid warnings about too-long initializer strings
Branches
Unknown
Tags
Unknown