~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initialize the register dumping machinery while testing assembler code.
[catacomb]
/
symm
/
chacha.c
diff --git
a/symm/chacha.c
b/symm/chacha.c
index
983f58c
..
8cc16b8
100644
(file)
--- a/
symm/chacha.c
+++ b/
symm/chacha.c
@@
-97,7
+97,8
@@
static core__functype *pick_core(void)
cpu_feature_p(CPUFEAT_ARM_NEON));
#endif
#if CPUFAM_ARM64
cpu_feature_p(CPUFEAT_ARM_NEON));
#endif
#if CPUFAM_ARM64
- DISPATCH_PICK_COND(chacha_core, chacha_core_arm64, 1);
+ DISPATCH_PICK_COND(chacha_core, chacha_core_arm64,
+ cpu_feature_p(CPUFEAT_ARM_NEON));
#endif
DISPATCH_PICK_FALLBACK(chacha_core, simple_core);
}
#endif
DISPATCH_PICK_FALLBACK(chacha_core, simple_core);
}
@@
-848,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) \
{ \
@@
-869,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" \
@@
-939,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" \
@@
-985,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);
}