aboutsummaryrefslogtreecommitdiff
path: root/tests/test
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-03-03 02:29:08 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-03-07 21:59:44 +0100
commit360691121ed49e3b684a4492c17e61e311de5087 (patch)
tree83b63f18040c75d44489b1ad77b87ae39e1c71a0 /tests/test
parentCleanup makefile. (diff)
downloadcalp-360691121ed49e3b684a4492c17e61e311de5087.tar.gz
calp-360691121ed49e3b684a4492c17e61e311de5087.tar.xz
Add tests for (crypto) module.
Diffstat (limited to 'tests/test')
-rw-r--r--tests/test/crypto.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test/crypto.scm b/tests/test/crypto.scm
new file mode 100644
index 00000000..610ac819
--- /dev/null
+++ b/tests/test/crypto.scm
@@ -0,0 +1,9 @@
+(use-modules ((crypto) :select (sha256 checksum->string)))
+
+(test-equal "sha256"
+ #vu8(24 95 141 179 34 113 254 37 245 97 166 252 147 139 46 38 67 6 236 48 78 218 81 128 7 209 118 72 38 56 25 105)
+ (sha256 "Hello"))
+
+(test-equal "sha256 string digest"
+ "185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969"
+ (checksum->string (sha256 "Hello")))