summaryrefslogtreecommitdiff
path: root/lib/std/test
diff options
context:
space:
mode:
authorLucas Gabriel Vuotto <lvuotto92@gmail.com>2017-09-09 10:42:01 -0300
committerOri Bernstein <ori@eigenstate.org>2017-09-09 12:17:12 -0700
commit7ef923fc9dfde99b672009f84340f5f398b96a80 (patch)
tree0479e6df115c66a2a368af3d4673b2ac4f37469c /lib/std/test
parentce24eebafcac443fd6572eff80e06b7303f37e36 (diff)
downloadmc-7ef923fc9dfde99b672009f84340f5f398b96a80.tar.gz
Improve siphash performance and tests
* Inline rotl * Be specific about which entry failed from the test vector Signed-off-by: Lucas Gabriel Vuotto <lvuotto92@gmail.com>
Diffstat (limited to 'lib/std/test')
-rw-r--r--lib/std/test/hashfuncs.myr6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/std/test/hashfuncs.myr b/lib/std/test/hashfuncs.myr
index 94313b0..f1684f9 100644
--- a/lib/std/test/hashfuncs.myr
+++ b/lib/std/test/hashfuncs.myr
@@ -108,10 +108,6 @@ const siphashreferencetestvector = {ctx
msg[i] = i
h = std.siphash24(msg[:i], key)
e = std.getle64(siphashtestvector[i][:])
- if e != h
- testr.fail(ctx, "wrong siphash value\n")
- else
- testr.ok(ctx)
- ;;
+ testr.check(ctx, e == h, "wrong siphash value for entry {}: got {x}\n", i, h)
;;
}