~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
math/Makefile.am, symm/Makefile.am: Use `--no-install' on oddball tests.
[catacomb]
/
symm
/
counter-def.h
diff --git
a/symm/counter-def.h
b/symm/counter-def.h
index
4553679
..
ad955db
100644
(file)
--- a/
symm/counter-def.h
+++ b/
symm/counter-def.h
@@
-65,7
+65,9
@@
* Use: Creates definitions for counter mode.
*/
* 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@ --- * \
* \
\
/* --- @pre_countergetiv@ --- * \
* \
@@
-299,7
+301,7
@@
static const gcipher_ops gops = { \
}; \
\
const gccipher pre##_counter = { \
}; \
\
const gccipher pre##_counter = { \
-
#pr
e "-counter", pre##_keysz, PRE##_BLKSZ, \
+
nam
e "-counter", pre##_keysz, PRE##_BLKSZ, \
ginit \
}; \
\
ginit \
}; \
\
@@
-395,7
+397,7
@@
static void grfill(grand *r, void *p, size_t sz) \
} \
\
static const grand_ops grops = { \
} \
\
static const grand_ops grops = { \
-
#pr
e "-counter", \
+
nam
e "-counter", \
GRAND_CRYPTO, 0, \
grmisc, grdestroy, \
grword, grbyte, grword, grand_defaultrange, grfill \
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); \
} \
\
return (&g->r); \
} \
\
-COUNTER_TEST
(PRE, pr
e)
+COUNTER_TEST
X(PRE, pre, name, fnam
e)
/*----- Test rig ----------------------------------------------------------*/
/*----- Test rig ----------------------------------------------------------*/
+#define COUNTER_TEST(PRE, pre) COUNTER_TESTX(PRE, pre, #pre, #pre)
+
#ifdef TEST_RIG
#include <stdio.h>
#ifdef TEST_RIG
#include <stdio.h>
@@
-437,7
+441,7
@@
COUNTER_TEST(PRE, pre)
* Use: Standard test rig for counter functions.
*/
* Use: Standard test rig for counter functions.
*/
-#define COUNTER_TEST
(PRE, pre)
\
+#define COUNTER_TEST
X(PRE, pre, name, fname)
\
\
/* --- Initial plaintext for the test --- */ \
\
\
/* --- Initial plaintext for the test --- */ \
\
@@
-474,7
+478,7
@@
int main(void) \
size_t keysz = PRE##_KEYSZ ? \
PRE##_KEYSZ : strlen((const char *)key); \
\
size_t keysz = PRE##_KEYSZ ? \
PRE##_KEYSZ : strlen((const char *)key); \
\
- fputs(
#pr
e "-counter: ", stdout); \
+ fputs(
nam
e "-counter: ", stdout); \
\
pre##_init(&k, key, keysz); \
pre##_countersetkey(&ctx, &k); \
\
pre##_init(&k, key, keysz); \
pre##_countersetkey(&ctx, &k); \
@@
-521,7
+525,7
@@
int main(void) \
}
#else
}
#else
-# define COUNTER_TEST
(PRE, pr
e)
+# define COUNTER_TEST
X(PRE, pre, name, fnam
e)
#endif
/*----- That's all, folks -------------------------------------------------*/
#endif
/*----- That's all, folks -------------------------------------------------*/