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);
}
#include <stdio.h>
#include <string.h>
+#include <mLib/macros.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) \
{ \
} \
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" \
} \
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" \
int main(int argc, char *argv[])
{
+#ifdef ENABLE_ASM_DEBUG
+ regdump_init();
+#endif
test_run(argc, argv, defs, SRCDIR"/t/chacha");
return (0);
}