+#define SALSAE \
+ E(salsa20, 20,, SALSA20) \
+ E(salsa20, 12,, SALSA20) \
+ E(salsa20, 8,, SALSA20) \
+ E(xsalsa20, 20, X, SALSA20) \
+ E(xsalsa20, 12, X, SALSA20) \
+ E(xsalsa20, 8, X, SALSA20) \
+ E(chacha, 20,, CHACHA) \
+ E(chacha, 12,, CHACHA) \
+ E(chacha, 8,, CHACHA) \
+ E(xchacha, 20, X, CHACHA) \
+ E(xchacha, 12, X, CHACHA) \
+ E(xchacha, 8, X, CHACHA)
+
+#define E(pre, r, x, BASE) pre##_##r##_INDEX,
+enum { SALSAE BOGUS_SALSA };
+#undef E
+
+#define SALSA20_GEN(pre, r) SALSA20_DECOR(pre, r, _rand)
+#define CHACHA_GEN(pre, r) pre##r##_rand
+
+#define SALSA20_NAME(r) SALSA20_NAME_##r
+#define XSALSA20_NAME(r) "x" SALSA20_NAME_##r
+#define CHACHA_NAME(r) "chacha" #r
+#define XCHACHA_NAME(r) "xchacha" #r
+
+static struct {
+ size_t noncesz;
+ grand *(*gen)(const void *, size_t, const void *);
+} salsatab[] = {
+#define E(pre, r, x, BASE) { x##BASE##_NONCESZ, BASE##_GEN(pre, r) },
+ SALSAE
+#undef E
+};
+