~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
math/t/{mpx,mpmont}: Add some extra tests for flushing out `mul4' bugs.
[catacomb]
/
symm
/
mgf-def.h
diff --git
a/symm/mgf-def.h
b/symm/mgf-def.h
index
529428f
..
832cd07
100644
(file)
--- a/
symm/mgf-def.h
+++ b/
symm/mgf-def.h
@@
-59,7
+59,9
@@
/*----- Macros ------------------------------------------------------------*/
/*----- Macros ------------------------------------------------------------*/
-#define MGF_DEF(PRE, pre) \
+#define MGF_DEF(PRE, pre) MGF_DEFX(PRE, pre, #pre, #pre)
+
+#define MGF_DEFX(PRE, pre, name, fname) \
\
/* --- Useful constants --- */ \
\
\
/* --- Useful constants --- */ \
\
@@
-235,7
+237,7
@@
static const gcipher_ops gops = { \
}; \
\
const gccipher pre##_mgf = { \
}; \
\
const gccipher pre##_mgf = { \
-
#pr
e "-mgf", pre##_mgfkeysz, 0, \
+
nam
e "-mgf", pre##_mgfkeysz, 0, \
ginit \
}; \
\
ginit \
}; \
\
@@
-324,7
+326,7
@@
static void grfill(grand *r, void *p, size_t sz) \
} \
\
static const grand_ops grops = { \
} \
\
static const grand_ops grops = { \
-
#pr
e "-mgf", \
+
nam
e "-mgf", \
GRAND_CRYPTO, 0, \
grmisc, grdestroy, \
grword, grbyte, grword, grand_defaultrange, grfill \
GRAND_CRYPTO, 0, \
grmisc, grdestroy, \
grword, grbyte, grword, grand_defaultrange, grfill \
@@
-349,10
+351,12
@@
extern grand *pre##_mgfrand(const void *k, size_t sz) \
return (&g->r); \
} \
\
return (&g->r); \
} \
\
-MGF_TEST
(PRE, pr
e)
+MGF_TEST
X(PRE, pre, name, fnam
e)
/*----- Test rig ----------------------------------------------------------*/
/*----- Test rig ----------------------------------------------------------*/
+#define MGF_TEST(PRE, pre) MGF_TESTX(PRE, pre, #pre, #pre)
+
#ifdef TEST_RIG
#include <stdio.h>
#ifdef TEST_RIG
#include <stdio.h>
@@
-366,7
+370,7
@@
MGF_TEST(PRE, pre)
* Use: Standard test rig for MGF functions.
*/
* Use: Standard test rig for MGF functions.
*/
-#define MGF_TEST
(PRE, pre)
\
+#define MGF_TEST
X(PRE, pre, name, fname)
\
\
/* --- Initial plaintext for the test --- */ \
\
\
/* --- Initial plaintext for the test --- */ \
\
@@
-400,7
+404,7
@@
int main(void) \
\
size_t keysz = strlen((const char *)key); \
\
\
size_t keysz = strlen((const char *)key); \
\
- fputs(
#pr
e "-mgf: ", stdout); \
+ fputs(
nam
e "-mgf: ", stdout); \
\
pre##_mgfinit(&ctx, key, keysz); \
\
\
pre##_mgfinit(&ctx, key, keysz); \
\
@@
-446,7
+450,7
@@
int main(void) \
}
#else
}
#else
-# define MGF_TEST
(PRE, pr
e)
+# define MGF_TEST
X(PRE, pre, name, fnam
e)
#endif
/*----- That's all, folks -------------------------------------------------*/
#endif
/*----- That's all, folks -------------------------------------------------*/