From 09cc7da77faded41646d0024acca2e5050a79096 Mon Sep 17 00:00:00 2001 From: Reini Urban Date: Sat, 23 Mar 2024 14:16:47 +0100 Subject: [PATCH] fix faoso4,6 seems to work correct now part of GH #13 --- source/algorithms.h | 2 +- source/algos/faoso4.c | 2 +- source/algos/faoso6.c | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/source/algorithms.h b/source/algorithms.h index 8f8618f91..0272abe7f 100644 --- a/source/algorithms.h +++ b/source/algorithms.h @@ -374,7 +374,7 @@ const struct algo ALGOS[] = { [_BWW] = {_BWW, OK, "bww", "bit parallel wide window", 0, 0}, [_FAOSO2] = {_FAOSO2, OK, "faoso2", "fast average optimal shift-or (u=2,m>2)", 3, 0}, [_FAOSO4] = {_FAOSO4, RNDCRASH, "faoso4", "fast average optimal shift-or (u=2,m>4)", 5, 0}, - [_FAOSO6] = {_FAOSO6, FAIL, "faoso6", "fast average optimal shift-or (u=2,m>6)", 7, 0}, + [_FAOSO6] = {_FAOSO6, RNDCRASH, "faoso6", "fast average optimal shift-or (u=2,m>6)", 7, 0}, [_AOSO2] = {_AOSO2, OK, "aoso2", "average optimal shift-or (q=2)", 2, 0}, [_AOSO4] = {_AOSO4, OK, "aoso4", "average optimal shift-or (q=4)", 4, 0}, [_AOSO6] = {_AOSO6, OK, "aoso6", "average optimal shift-or (q=6)", 6, 0}, diff --git a/source/algos/faoso4.c b/source/algos/faoso4.c index 2f8371e13..577a16d8a 100644 --- a/source/algos/faoso4.c +++ b/source/algos/faoso4.c @@ -135,7 +135,7 @@ void verify_large(unsigned char *y, int j, /*int n,*/ unsigned char *x, int m, c -= (s / v + z * q); i = j + c; if (!memcmp(x, y + i, p_len)) { - (*count)++; + OUTPUT(i); // printf("%d\n",i); } D &= ~(1U << s); diff --git a/source/algos/faoso6.c b/source/algos/faoso6.c index e078243a8..2caa8cc9a 100644 --- a/source/algos/faoso6.c +++ b/source/algos/faoso6.c @@ -22,7 +22,6 @@ * Science, vol.3772, pp.376--387, Springer-Verlag, Berlin, (2005). * * Constraints: requires m>6 - * Note: Broken search_large() m>31 */ #include @@ -141,7 +140,7 @@ void verify_large(unsigned char *y, int j, int n, unsigned char *x, int m, while (k < p_len && x[k] == y[i + k]) k++; if (k == p_len) - (*count)++; + OUTPUTP(i); D &= ~(1U << s); } }