summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-11-24 16:28:24 -0800
committerOri Bernstein <ori@eigenstate.org>2016-11-24 16:44:21 -0800
commit6c434100fac87e19234389aba2329165827d0711 (patch)
treec76963ca6d2dd9ba8d65da1f64117945b472e978 /lib
parent49f27bf2a929c681f40752da7329e377030198a3 (diff)
downloadmc-6c434100fac87e19234389aba2329165827d0711.tar.gz
Rename 'libcryptohash' to 'libcrypto'
The ciphers are coming. Hold on to your hats. The ciphers are coming.
Diffstat (limited to 'lib')
-rw-r--r--lib/bld.sub2
-rw-r--r--lib/crypto/bld.sub (renamed from lib/cryptohash/bld.sub)8
-rw-r--r--lib/crypto/md5.myr (renamed from lib/cryptohash/md5.myr)2
-rw-r--r--lib/crypto/sha1.myr (renamed from lib/cryptohash/sha1.myr)2
-rw-r--r--lib/crypto/sha256.myr (renamed from lib/cryptohash/sha256.myr)2
-rw-r--r--lib/crypto/sha512.myr (renamed from lib/cryptohash/sha512.myr)2
-rw-r--r--lib/crypto/test/md5.myr18
-rw-r--r--lib/crypto/test/sha1.myr18
-rw-r--r--lib/crypto/test/sha256.myr (renamed from lib/cryptohash/test/sha256.myr)18
-rw-r--r--lib/crypto/test/sha512.myr (renamed from lib/cryptohash/test/sha512.myr)18
-rw-r--r--lib/crypto/test/util.myr (renamed from lib/cryptohash/test/util.myr)0
-rw-r--r--lib/cryptohash/test/md5.myr18
-rw-r--r--lib/cryptohash/test/sha1.myr18
13 files changed, 66 insertions, 60 deletions
diff --git a/lib/bld.sub b/lib/bld.sub
index 4e3f2d0..2ee020e 100644
--- a/lib/bld.sub
+++ b/lib/bld.sub
@@ -1,7 +1,7 @@
sub =
bio
date
- cryptohash
+ crypto
escfmt
inifile
fileutil
diff --git a/lib/cryptohash/bld.sub b/lib/crypto/bld.sub
index a8df6d4..9688fc7 100644
--- a/lib/cryptohash/bld.sub
+++ b/lib/crypto/bld.sub
@@ -1,9 +1,15 @@
-lib cryptohash =
+testdeps = ../testr:testr ;;
+
+lib crypto =
+ # hashes
md5.myr
sha1.myr
sha256.myr
sha512.myr
+ # ciphers
+ chacha20.myr
+
lib ../std:std
lib ../sys:sys
;;
diff --git a/lib/cryptohash/md5.myr b/lib/crypto/md5.myr
index 931803b..04142f1 100644
--- a/lib/cryptohash/md5.myr
+++ b/lib/crypto/md5.myr
@@ -1,6 +1,6 @@
use std
-pkg cryptohash =
+pkg crypto =
type md5
const md5 : (data : byte[:] -> byte[16])
diff --git a/lib/cryptohash/sha1.myr b/lib/crypto/sha1.myr
index c1c9561..949074a 100644
--- a/lib/cryptohash/sha1.myr
+++ b/lib/crypto/sha1.myr
@@ -1,6 +1,6 @@
use std
-pkg cryptohash =
+pkg crypto =
type sha1
const sha1 : (data : byte[:] -> byte[20])
diff --git a/lib/cryptohash/sha256.myr b/lib/crypto/sha256.myr
index cf0bdef..a83804e 100644
--- a/lib/cryptohash/sha256.myr
+++ b/lib/crypto/sha256.myr
@@ -1,6 +1,6 @@
use std
-pkg cryptohash =
+pkg crypto =
type sha256
type sha224
diff --git a/lib/cryptohash/sha512.myr b/lib/crypto/sha512.myr
index 8a0d274..d9d8dd9 100644
--- a/lib/cryptohash/sha512.myr
+++ b/lib/crypto/sha512.myr
@@ -1,6 +1,6 @@
use std
-pkg cryptohash =
+pkg crypto =
type sha512
type sha384
diff --git a/lib/crypto/test/md5.myr b/lib/crypto/test/md5.myr
new file mode 100644
index 0000000..0548051
--- /dev/null
+++ b/lib/crypto/test/md5.myr
@@ -0,0 +1,18 @@
+use std
+use crypto
+
+use "test/util"
+
+const main = {
+ hasheq(crypto.md5("")[:], \
+ "d41d8cd98f00b204e9800998ecf8427e")
+ hasheq(crypto.md5("h")[:], \
+ "2510c39011c5be704182423e3a695e91")
+ /* 64 byte block */
+ hasheq(crypto.md5("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")[:], \
+ "014842d480b571495a4a0363793f7367")
+ /* tail spanning */
+ hasheq(crypto.md5("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb")[:], \
+ "3b0bb4c5ece4a6568caa7266e740a140")
+}
+
diff --git a/lib/crypto/test/sha1.myr b/lib/crypto/test/sha1.myr
new file mode 100644
index 0000000..22813d9
--- /dev/null
+++ b/lib/crypto/test/sha1.myr
@@ -0,0 +1,18 @@
+use std
+use crypto
+
+use "test/util"
+
+const main = {
+ hasheq(crypto.sha1("")[:], \
+ "da39a3ee5e6b4b0d3255bfef60951890d8af0709")
+ hasheq(crypto.sha1("h")[:], \
+ "27d5482eebd075de44389774e2fc8c695cf48a75")
+ /* 64 byte block */
+ hasheq(crypto.sha1("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")[:], \
+ "0098ba824b5c16427bd7a1125a2a442aec25644d")
+ /* tail spanning */
+ hasheq(crypto.sha1("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb")[:], \
+ "4eb17e52bb55910b037869438f69d9c87643d75a")
+}
+
diff --git a/lib/cryptohash/test/sha256.myr b/lib/crypto/test/sha256.myr
index addc9db..e883c84 100644
--- a/lib/cryptohash/test/sha256.myr
+++ b/lib/crypto/test/sha256.myr
@@ -1,29 +1,29 @@
use std
-use cryptohash
+use crypto
use "test/util"
const main = {
- hasheq(cryptohash.sha224("")[:], \
+ hasheq(crypto.sha224("")[:], \
"d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f")
- hasheq(cryptohash.sha224("h")[:], \
+ hasheq(crypto.sha224("h")[:], \
"e0ccaeadfef916630c35576679e4cd4b438e7fc95a60b7361705f708")
/* 64 byte block */
- hasheq(cryptohash.sha224("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")[:], \
+ hasheq(crypto.sha224("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")[:], \
"a88cd5cde6d6fe9136a4e58b49167461ea95d388ca2bdb7afdc3cbf4")
/* tail spanning */
- hasheq(cryptohash.sha224("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb")[:], \
+ hasheq(crypto.sha224("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb")[:], \
"4a5859b7efa22c3b25710520fc97b0a901f5cdba3e4f0becfeea725e")
- hasheq(cryptohash.sha256("")[:], \
+ hasheq(crypto.sha256("")[:], \
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")
- hasheq(cryptohash.sha256("h")[:], \
+ hasheq(crypto.sha256("h")[:], \
"aaa9402664f1a41f40ebbc52c9993eb66aeb366602958fdfaa283b71e64db123")
/* 64 byte block */
- hasheq(cryptohash.sha256("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")[:], \
+ hasheq(crypto.sha256("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")[:], \
"ffe054fe7ae0cb6dc65c3af9b61d5209f439851db43d0ba5997337df154668eb")
/* tail spanning */
- hasheq(cryptohash.sha256("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb")[:], \
+ hasheq(crypto.sha256("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb")[:], \
"bac8bf0f9794a520a5bf0ec64d3206edd1b9f2ef5ea118c9cad5365d84578de4")
}
diff --git a/lib/cryptohash/test/sha512.myr b/lib/crypto/test/sha512.myr
index 4d81816..0ae81e4 100644
--- a/lib/cryptohash/test/sha512.myr
+++ b/lib/crypto/test/sha512.myr
@@ -1,29 +1,29 @@
use std
-use cryptohash
+use crypto
use "test/util"
const main = {
- hasheq(cryptohash.sha384("")[:], \
+ hasheq(crypto.sha384("")[:], \
"38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b")
- hasheq(cryptohash.sha384("h")[:], \
+ hasheq(crypto.sha384("h")[:], \
"a4eb0778c79fce94c02126543cba398d645b2fd4c6ff6a02eecc026bbe0cc0dd666279722b7615bc15b4c9126b941c04")
/* 64 byte block */
- hasheq(cryptohash.sha384("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")[:], \
+ hasheq(crypto.sha384("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")[:], \
"2e404b9339da795776e510d96930b3be2904c500395b8cb7413334b82d4dec413b4b8113045a05bbbcff846f027423f6")
/* tail spanning */
- hasheq(cryptohash.sha384("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb")[:], \
+ hasheq(crypto.sha384("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb")[:], \
"f8f4b55a0fb1ac8506d2e5195c714a1ad16c3bf61ad8b2d544344b105a49a77ff3b8eb61e8f970a71864e9dad87042b1")
- hasheq(cryptohash.sha512("")[:], \
+ hasheq(crypto.sha512("")[:], \
"cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e")
- hasheq(cryptohash.sha512("h")[:], \
+ hasheq(crypto.sha512("h")[:], \
"2241bc8fc70705b42efead371fd4982c5ba69917e5b4b895810002644f0386da9c3131793458c2bf47608480d64a07278133c99912e0ba2daf23098f3520eb97")
/* 64 byte block */
- hasheq(cryptohash.sha512("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")[:], \
+ hasheq(crypto.sha512("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")[:], \
"01d35c10c6c38c2dcf48f7eebb3235fb5ad74a65ec4cd016e2354c637a8fb49b695ef3c1d6f7ae4cd74d78cc9c9bcac9d4f23a73019998a7f73038a5c9b2dbde")
/* tail spanning */
- hasheq(cryptohash.sha512("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb")[:], \
+ hasheq(crypto.sha512("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb")[:], \
"d5c989d2e41299b6bfd57562b4b09cd2efa56f13c8fa109e0ce5ddbd6bfb5b34f8563608d6162104bef750023732581f22704d5df43feecbb05742be1d7c34fa")
}
diff --git a/lib/cryptohash/test/util.myr b/lib/crypto/test/util.myr
index ceb411c..ceb411c 100644
--- a/lib/cryptohash/test/util.myr
+++ b/lib/crypto/test/util.myr
diff --git a/lib/cryptohash/test/md5.myr b/lib/cryptohash/test/md5.myr
deleted file mode 100644
index 87f0976..0000000
--- a/lib/cryptohash/test/md5.myr
+++ /dev/null
@@ -1,18 +0,0 @@
-use std
-use cryptohash
-
-use "test/util"
-
-const main = {
- hasheq(cryptohash.md5("")[:], \
- "d41d8cd98f00b204e9800998ecf8427e")
- hasheq(cryptohash.md5("h")[:], \
- "2510c39011c5be704182423e3a695e91")
- /* 64 byte block */
- hasheq(cryptohash.md5("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")[:], \
- "014842d480b571495a4a0363793f7367")
- /* tail spanning */
- hasheq(cryptohash.md5("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb")[:], \
- "3b0bb4c5ece4a6568caa7266e740a140")
-}
-
diff --git a/lib/cryptohash/test/sha1.myr b/lib/cryptohash/test/sha1.myr
deleted file mode 100644
index 4914a60..0000000
--- a/lib/cryptohash/test/sha1.myr
+++ /dev/null
@@ -1,18 +0,0 @@
-use std
-use cryptohash
-
-use "test/util"
-
-const main = {
- hasheq(cryptohash.sha1("")[:], \
- "da39a3ee5e6b4b0d3255bfef60951890d8af0709")
- hasheq(cryptohash.sha1("h")[:], \
- "27d5482eebd075de44389774e2fc8c695cf48a75")
- /* 64 byte block */
- hasheq(cryptohash.sha1("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")[:], \
- "0098ba824b5c16427bd7a1125a2a442aec25644d")
- /* tail spanning */
- hasheq(cryptohash.sha1("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb")[:], \
- "4eb17e52bb55910b037869438f69d9c87643d75a")
-}
-