-void pre##_macdone(pre##_macctx *ctx, void *mac) \
-{ \
- pre##_done(&ctx->ctx, mac); \
- pre##_set(&ctx->ctx, ctx->chain, ctx->count); \
- pre##_hash(&ctx->ctx, mac, PRE##_HASHSZ); \
- pre##_done(&ctx->ctx, mac); \
-} \
- \
-HMAC_TEST(PRE, pre) \
-
-/* --- @HMAC_TEST@ --- *
- *
- * Arguments: @PRE@, @pre@ = prefixes for hash-specfic definitions
- *
- * Use: Standard test rig for MAC functions.
- */
-
-#ifdef TEST_RIG
-
-#include <mLib/dstr.h>
-#include <mLib/quis.h>
-#include <mLib/testrig.h>
-
-#define HMAC_TEST(PRE, pre) \
- \
-static int macverify(dstr *v) \
-{ \
- pre##_macctx cctx; \
- pre##_mackey ckey; \
- int ok = 1; \
- int i; \
- octet *p; \
- int szs[] = { 1, 7, 192, -1, 0 }, *ip; \
- size_t csz; \
- dstr d; \
- \
- dstr_create(&d); \
- dstr_ensure(&d, PRE##_HASHSZ); \
- d.len = PRE##_HASHSZ; \
- \
- pre##_hmac(&ckey, v[1].buf, v[1].len); \