- /* --- Construct the various keys --- *
- *
- * This is done with macros, because it's quite tedious.
- */
-
-#define MINE GH_HASH(h, pp, x)
-#define YOURS GH_HASH(h, pp + x, y - x)
-#define OURS GH_HASH(h, pp + y, z - y)
-
-#define HASH_in MINE; YOURS; OURS
-#define HASH_out YOURS; MINE; OURS
-#define INIT_c(k) GC_INIT(algs.c, (k), algs.cksz)
-#define INIT_m(k) GM_KEY(algs.m, (k), algs.mksz)
-#define STR_c "encryption"
-#define STR_m "integrity"
-#define STR_in "incoming"
-#define STR_out "outgoing"
-
-#define SETKEY(a, dir) do { \
- h = GH_INIT(algs.h); \
- HASH_STRING(h, "tripe-" STR_##a); \
- HASH_##dir; \
- hh = GH_DONE(h, 0); \
- IF_TRACING(T_KEYSET, { \
- trace_block(T_CRYPTO, "crypto: " STR_##dir " key " STR_##a, \
- hh, algs.a##ksz); \
- }) \
- ks->a##dir = INIT_##a(hh); \
- GH_DESTROY(h); \
-} while (0)
-
- SETKEY(c, in); SETKEY(c, out);
- SETKEY(m, in); SETKEY(m, out);
-
-#undef MINE
-#undef YOURS
-#undef OURS
-#undef STR_c
-#undef STR_m
-#undef STR_in
-#undef STR_out
-#undef INIT_c
-#undef INIT_m
-#undef HASH_in
-#undef HASH_out
-#undef SETKEY