~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
progs/perftest.c: Use from Glibc syscall numbers.
[catacomb]
/
symm
/
chacha.c
diff --git
a/symm/chacha.c
b/symm/chacha.c
index
90a4c67
..
8cc16b8
100644
(file)
--- a/
symm/chacha.c
+++ b/
symm/chacha.c
@@
-849,9
+849,14
@@
CHACHA_VARS(DEFXGRAND)
#include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <string.h>
+#include <mLib/macros.h>
#include <mLib/quis.h>
#include <mLib/testrig.h>
#include <mLib/quis.h>
#include <mLib/testrig.h>
+#ifdef ENABLE_ASM_DEBUG
+# include "regdump.h"
+#endif
+
#define DEFVCORE(r) \
static int v_core_##r(dstr *v) \
{ \
#define DEFVCORE(r) \
static int v_core_##r(dstr *v) \
{ \
@@
-870,7
+875,7
@@
CHACHA_VARS(DEFXGRAND)
} \
for (i = 0; i < CHACHA_OUTSZ/4; i++) STORE32_L(d.buf + 4*i, a[i]); \
\
} \
for (i = 0; i < CHACHA_OUTSZ/4; i++) STORE32_L(d.buf + 4*i, a[i]); \
\
- if (d.len != v[2].len ||
memcmp(d.buf, v[2].buf, v[2].len) != 0) {
\
+ if (d.len != v[2].len ||
MEMCMP(d.buf, !=, v[2].buf, v[2].len)) {
\
ok = 0; \
printf("\nfail core:" \
"\n\titerations = %d" \
ok = 0; \
printf("\nfail core:" \
"\n\titerations = %d" \
@@
-940,7
+945,7
@@
CHACHA_VARS(DEFVCORE)
} \
if (sz) BASE##_ENCRYPT(r, &ctx, p, q, sz); \
\
} \
if (sz) BASE##_ENCRYPT(r, &ctx, p, q, sz); \
\
- if (d.len != v[5].len ||
memcmp(d.buf, v[5].buf, v[5].len) != 0) {
\
+ if (d.len != v[5].len ||
MEMCMP(d.buf, !=, v[5].buf, v[5].len)) {
\
ok = 0; \
printf("\nfail encrypt:" \
"\n\tstep = %lu" \
ok = 0; \
printf("\nfail encrypt:" \
"\n\tstep = %lu" \
@@
-986,6
+991,9
@@
CHACHA_VARS(DEFXTAB)
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
+#ifdef ENABLE_ASM_DEBUG
+ regdump_init();
+#endif
test_run(argc, argv, defs, SRCDIR"/t/chacha");
return (0);
}
test_run(argc, argv, defs, SRCDIR"/t/chacha");
return (0);
}