~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
progs/perftest.c: Rename `c_start', `c_stop' to `c0', c1'.
[catacomb]
/
symm
/
cfb-def.h
diff --git
a/symm/cfb-def.h
b/symm/cfb-def.h
index
4f0f38f
..
78aa6d9
100644
(file)
--- a/
symm/cfb-def.h
+++ b/
symm/cfb-def.h
@@
-68,7
+68,9
@@
* Use: Creates an implementation for CFB mode.
*/
* Use: Creates an implementation for CFB mode.
*/
-#define CFB_DEF(PRE, pre) \
+#define CFB_DEF(PRE, pre) CFB_DEFX(PRE, pre, #pre, #pre)
+
+#define CFB_DEFX(PRE, pre, name, fname) \
\
/* --- @pre_cfbgetiv@ --- * \
* \
\
/* --- @pre_cfbgetiv@ --- * \
* \
@@
-389,14
+391,16
@@
static const gcipher_ops gops = { \
}; \
\
const gccipher pre##_cfb = { \
}; \
\
const gccipher pre##_cfb = { \
-
#pr
e "-cfb", pre##_keysz, PRE##_BLKSZ, \
+
nam
e "-cfb", pre##_keysz, PRE##_BLKSZ, \
ginit \
}; \
\
ginit \
}; \
\
-CFB_TEST
(PRE, pr
e)
+CFB_TEST
X(PRE, pre, name, fnam
e)
/*----- Test rig ----------------------------------------------------------*/
/*----- Test rig ----------------------------------------------------------*/
+#define CFB_TEST(PRE, pre) CFB_TESTX(PRE, pre, #pre, #pre)
+
#ifdef TEST_RIG
#include <stdio.h>
#ifdef TEST_RIG
#include <stdio.h>
@@
-410,7
+414,7
@@
CFB_TEST(PRE, pre)
* Use: Standard test rig for CFB functions.
*/
* Use: Standard test rig for CFB functions.
*/
-#define CFB_TEST
(PRE, pre)
\
+#define CFB_TEST
X(PRE, pre, name, fname)
\
\
/* --- Initial plaintext for the test --- */ \
\
\
/* --- Initial plaintext for the test --- */ \
\
@@
-447,7
+451,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 "-cfb: ", stdout); \
+ fputs(
nam
e "-cfb: ", stdout); \
\
pre##_init(&k, key, keysz); \
pre##_cfbsetkey(&ctx, &k); \
\
pre##_init(&k, key, keysz); \
pre##_cfbsetkey(&ctx, &k); \
@@
-494,7
+498,7
@@
int main(void) \
}
#else
}
#else
-# define CFB_TEST
(PRE, pr
e)
+# define CFB_TEST
X(PRE, pre, name, fnam
e)
#endif
/*----- That's all, folks -------------------------------------------------*/
#endif
/*----- That's all, folks -------------------------------------------------*/