ref: bf8b4ecc51a8adc0eee50424f5e1a13f3a20452e
parent: 96c22e7e846b1aecc6acbf75b15eedf53923fdd1
author: Ori Bernstein <[email protected]>
date: Fri May 30 06:24:04 EDT 2014
Add test source for sha1. Oops. Forgot.
--- /dev/null
+++ b/libcryptohash/test/sha1-test.myr
@@ -1,0 +1,22 @@
+use std
+use cryptohash
+
+const main = {
+ print(cryptohash.sha1(""))
+ print(cryptohash.sha1("h"))
+ /* 64 byte block */
+ print(cryptohash.sha1("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"))
+ /* tail spanning */
+ print(cryptohash.sha1("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb"))
+}
+
+const print = {b
+ for x in b
+ if (x <= 0xf)
+ std.put("0%xb", x)
+ else
+ std.put("%xb", x)
+ ;;
+ ;;
+ std.put("\n")
+}