From: Niels Möller Date: Sun, 22 Jun 2025 15:22:00 +0000 (+0200) Subject: Use alignas for hmac inner and outer state. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b058a11478c2800c14898e77a1c46a337a440a9;p=thirdparty%2Fnettle.git Use alignas for hmac inner and outer state. --- diff --git a/hmac.h b/hmac.h index 8f6f3dbc..e7ecc63d 100644 --- a/hmac.h +++ b/hmac.h @@ -34,6 +34,8 @@ #ifndef NETTLE_HMAC_H_INCLUDED #define NETTLE_HMAC_H_INCLUDED +#include + #include "nettle-meta.h" #include "gosthash94.h" @@ -83,10 +85,10 @@ extern "C" { #define hmac_sm3_update nettle_hmac_sm3_update #define hmac_sm3_digest nettle_hmac_sm3_digest -#define _NETTLE_HMAC_CTX(type) { \ - char outer[offsetof (type, index)]; \ - char inner[offsetof (type, index)]; \ - type state; \ +#define _NETTLE_HMAC_CTX(type) { \ + alignas(type) char outer[offsetof (type, index)]; \ + alignas(type) char inner[offsetof (type, index)]; \ + type state; \ } /* hmac-md5 */