X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/abdc0d5fcaa72bef72d1dc49290c1db8d68229f3..HEAD:/symm/salsa20.c diff --git a/symm/salsa20.c b/symm/salsa20.c index e7c35f4f..f0fe3d7c 100644 --- a/symm/salsa20.c +++ b/symm/salsa20.c @@ -871,9 +871,14 @@ SALSA20_VARS(DEFXGRAND) #include #include +#include #include #include +#ifdef ENABLE_ASM_DEBUG +# include "regdump.h" +#endif + static const int perm[] = { 0, 13, 10, 7, 4, 1, 14, 11, @@ -900,7 +905,7 @@ static const int perm[] = { } \ for (i = 0; i < SALSA20_OUTSZ/4; i++) STORE32_L(d.buf + 4*i, b[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" \ @@ -970,7 +975,7 @@ SALSA20_VARS(DEFVCORE) } \ 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" \ @@ -1016,6 +1021,9 @@ SALSA20_VARS(DEFXTAB) int main(int argc, char *argv[]) { +#ifdef ENABLE_ASM_DEBUG + regdump_init(); +#endif test_run(argc, argv, defs, SRCDIR"/t/salsa20"); return (0); }