math/Makefile.am, symm/Makefile.am: Use `--no-install' on oddball tests.
[catacomb] / symm / counter-def.h
index 4553679..ad955db 100644 (file)
@@ -65,7 +65,9 @@
  * Use:                Creates definitions for counter mode.
  */
 
-#define COUNTER_DEF(PRE, pre)                                          \
+#define COUNTER_DEF(PRE, pre) COUNTER_DEFX(PRE, pre, #pre, #pre)
+
+#define COUNTER_DEFX(PRE, pre, name, fname)                            \
                                                                        \
 /* --- @pre_countergetiv@ --- *                                                \
  *                                                                     \
@@ -299,7 +301,7 @@ static const gcipher_ops gops = {                                   \
 };                                                                     \
                                                                        \
 const gccipher pre##_counter = {                                       \
-  #pre "-counter", pre##_keysz, PRE##_BLKSZ,                           \
+  name "-counter", pre##_keysz, PRE##_BLKSZ,                           \
   ginit                                                                        \
 };                                                                     \
                                                                        \
@@ -395,7 +397,7 @@ static void grfill(grand *r, void *p, size_t sz)                    \
 }                                                                      \
                                                                        \
 static const grand_ops grops = {                                       \
-  #pre "-counter",                                                     \
+  name "-counter",                                                     \
   GRAND_CRYPTO, 0,                                                     \
   grmisc, grdestroy,                                                   \
   grword, grbyte, grword, grand_defaultrange, grfill                   \
@@ -420,10 +422,12 @@ grand *pre##_counterrand(const void *k, size_t sz)                        \
   return (&g->r);                                                      \
 }                                                                      \
                                                                        \
-COUNTER_TEST(PRE, pre)
+COUNTER_TESTX(PRE, pre, name, fname)
 
 /*----- Test rig ----------------------------------------------------------*/
 
+#define COUNTER_TEST(PRE, pre) COUNTER_TESTX(PRE, pre, #pre, #pre)
+
 #ifdef TEST_RIG
 
 #include <stdio.h>
@@ -437,7 +441,7 @@ COUNTER_TEST(PRE, pre)
  * Use:                Standard test rig for counter functions.
  */
 
-#define COUNTER_TEST(PRE, pre)                                         \
+#define COUNTER_TESTX(PRE, pre, name, fname)                           \
                                                                        \
 /* --- Initial plaintext for the test --- */                           \
                                                                        \
@@ -474,7 +478,7 @@ int main(void)                                                              \
   size_t keysz = PRE##_KEYSZ ?                                         \
     PRE##_KEYSZ : strlen((const char *)key);                           \
                                                                        \
-  fputs(#pre "-counter: ", stdout);                                    \
+  fputs(name "-counter: ", stdout);                                    \
                                                                        \
   pre##_init(&k, key, keysz);                                          \
   pre##_countersetkey(&ctx, &k);                                       \
@@ -521,7 +525,7 @@ int main(void)                                                              \
 }
 
 #else
-#  define COUNTER_TEST(PRE, pre)
+#  define COUNTER_TESTX(PRE, pre, name, fname)
 #endif
 
 /*----- That's all, folks -------------------------------------------------*/