aboutsummaryrefslogtreecommitdiffstats
path: root/test.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-02-10 17:10:20 +0100
committerMattias Andrée <maandree@kth.se>2019-02-10 17:11:30 +0100
commit32a5ae4e65844615cb3e32aaefcdb7abe4af54c9 (patch)
tree0ecfa02766944f2568b184d8d5a8ba0edc71425f /test.c
parentUse lowest bits rather than highest bits in complete byte, document this, and add tests (diff)
downloadlibsha2-32a5ae4e65844615cb3e32aaefcdb7abe4af54c9.tar.gz
libsha2-32a5ae4e65844615cb3e32aaefcdb7abe4af54c9.tar.bz2
libsha2-32a5ae4e65844615cb3e32aaefcdb7abe4af54c9.tar.xz
Add HMAC and use void * instead of char * for binary data
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'test.c')
-rw-r--r--test.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/test.c b/test.c
index 6cd664e..87da91f 100644
--- a/test.c
+++ b/test.c
@@ -36,17 +36,17 @@
#define test_repeated_huge(CHR, N, ALGO, EXPECTED)\
do {\
- size_t n = N;\
+ size_t n__ = N;\
if (skip_huge)\
break;\
memset(buf, CHR, sizeof(buf));\
test(!libsha2_init(&s, ALGO));\
fprintf(stderr, "processing huge message: 0 %%\n");\
- for (; n > sizeof(buf); n -= sizeof(buf)) {\
+ for (; n__ > sizeof(buf); n__ -= sizeof(buf)) {\
libsha2_update(&s, buf, sizeof(buf) * 8);\
- fprintf(stderr, "\033[A\033[Kprocessing huge message: %zu %%\n", ((N) - n) * 100 / (N));\
+ fprintf(stderr, "\033[A\033[Kprocessing huge message: %zu %%\n", ((N) - n__) * 100 / (N));\
}\
- libsha2_update(&s, buf, n * 8);\
+ libsha2_update(&s, buf, n__ * 8);\
fprintf(stderr, "\033[A\033[K");\
fflush(stderr);\
libsha2_digest(&s, NULL, 0, buf);\