uint8_t *digest);
-#define HMAC_CTX(type, size) \
-{ char outer[size]; char inner[size]; type state; }
+#define _NETTLE_HMAC_CTX(type) { \
+ char outer[offsetof (type, index)]; \
+ char inner[offsetof (type, index)]; \
+ type state; \
+ }
-#define OLD_HMAC_CTX(type) \
+#define HMAC_CTX(type) \
{ type outer; type inner; type state; }
#define HMAC_SET_KEY(ctx, hash, length, key) \
/* HMAC using specific hash functions */
/* hmac-md5 */
-struct hmac_md5_ctx HMAC_CTX(struct md5_ctx, offsetof (struct md5_ctx, index));
+struct hmac_md5_ctx _NETTLE_HMAC_CTX (struct md5_ctx);
void
hmac_md5_set_key(struct hmac_md5_ctx *ctx,
/* hmac-ripemd160 */
-struct hmac_ripemd160_ctx HMAC_CTX(struct ripemd160_ctx, offsetof (struct ripemd160_ctx, index));
+struct hmac_ripemd160_ctx _NETTLE_HMAC_CTX (struct ripemd160_ctx);
void
hmac_ripemd160_set_key(struct hmac_ripemd160_ctx *ctx,
/* hmac-sha1 */
-struct hmac_sha1_ctx HMAC_CTX (struct sha1_ctx, offsetof (struct sha1_ctx, index));
+struct hmac_sha1_ctx _NETTLE_HMAC_CTX (struct sha1_ctx);
void
hmac_sha1_set_key(struct hmac_sha1_ctx *ctx,
uint8_t *digest);
/* hmac-sha256 */
-struct hmac_sha256_ctx HMAC_CTX (struct sha256_ctx, offsetof(struct sha256_ctx, index));
+struct hmac_sha256_ctx _NETTLE_HMAC_CTX (struct sha256_ctx);
void
hmac_sha256_set_key(struct hmac_sha256_ctx *ctx,
uint8_t *digest);
/* hmac-sha512 */
-struct hmac_sha512_ctx HMAC_CTX (struct sha512_ctx, offsetof (struct sha512_ctx, index));
+struct hmac_sha512_ctx _NETTLE_HMAC_CTX (struct sha512_ctx);
void
hmac_sha512_set_key(struct hmac_sha512_ctx *ctx,
uint8_t *digest);
/* hmac-gosthash94 */
-struct hmac_gosthash94_ctx HMAC_CTX (struct gosthash94_ctx, offsetof (struct gosthash94_ctx,index));
+struct hmac_gosthash94_ctx _NETTLE_HMAC_CTX (struct gosthash94_ctx);
void
hmac_gosthash94_set_key(struct hmac_gosthash94_ctx *ctx,
/* hmac-streebog */
-struct hmac_streebog512_ctx HMAC_CTX (struct streebog512_ctx, offsetof (struct streebog512_ctx, index));
+struct hmac_streebog512_ctx _NETTLE_HMAC_CTX (struct streebog512_ctx);
void
hmac_streebog512_set_key(struct hmac_streebog512_ctx *ctx,
uint8_t *digest);
/* hmac-sm3 */
-struct hmac_sm3_ctx HMAC_CTX (struct sm3_ctx, offsetof (struct sm3_ctx, index));
+struct hmac_sm3_ctx _NETTLE_HMAC_CTX (struct sm3_ctx);
void
hmac_sm3_set_key(struct hmac_sm3_ctx *ctx,