~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
base/dispatch.c, etc.: Check that `rdrand' works.
[catacomb]
/
symm
/
cbc-def.h
diff --git
a/symm/cbc-def.h
b/symm/cbc-def.h
index
56c8f05
..
907a5db
100644
(file)
--- a/
symm/cbc-def.h
+++ b/
symm/cbc-def.h
@@
-64,7
+64,9
@@
* Use: Creates an implementation for CBC stealing mode.
*/
* Use: Creates an implementation for CBC stealing mode.
*/
-#define CBC_DEF(PRE, pre) \
+#define CBC_DEF(PRE, pre) CBC_DEFX(PRE, pre, #pre, #pre)
+
+#define CBC_DEFX(PRE, pre, name, fname) \
\
/* --- @pre_cbcgetiv@ --- * \
* \
\
/* --- @pre_cbcgetiv@ --- * \
* \
@@
-430,14
+432,16
@@
static const gcipher_ops gops = { \
}; \
\
const gccipher pre##_cbc = { \
}; \
\
const gccipher pre##_cbc = { \
-
#pr
e "-cbc", pre##_keysz, PRE##_BLKSZ, \
+
nam
e "-cbc", pre##_keysz, PRE##_BLKSZ, \
ginit \
}; \
\
ginit \
}; \
\
-CBC_TEST
(PRE, pr
e)
+CBC_TEST
X(PRE, pre, name, fnam
e)
/*----- Test rig ----------------------------------------------------------*/
/*----- Test rig ----------------------------------------------------------*/
+#define CBC_TEST(PRE, pre) CBC_TESTX(PRE, pre, #pre, #pre)
+
#ifdef TEST_RIG
#include <stdio.h>
#ifdef TEST_RIG
#include <stdio.h>
@@
-451,7
+455,7
@@
CBC_TEST(PRE, pre)
* Use: Standard test rig for CBC functions.
*/
* Use: Standard test rig for CBC functions.
*/
-#define CBC_TEST
(PRE, pre)
\
+#define CBC_TEST
X(PRE, pre, name, fname)
\
\
/* --- Initial plaintext for the test --- */ \
\
\
/* --- Initial plaintext for the test --- */ \
\
@@
-488,7
+492,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 "-cbc: ", stdout); \
+ fputs(
nam
e "-cbc: ", stdout); \
\
pre##_init(&k, key, keysz); \
pre##_cbcsetkey(&ctx, &k); \
\
pre##_init(&k, key, keysz); \
pre##_cbcsetkey(&ctx, &k); \
@@
-535,7
+539,7
@@
int main(void) \
}
#else
}
#else
-# define CBC_TEST
(PRE, pr
e)
+# define CBC_TEST
X(PRE, pre, name, fnam
e)
#endif
/*----- That's all, folks -------------------------------------------------*/
#endif
/*----- That's all, folks -------------------------------------------------*/