summaryrefslogtreecommitdiff
path: root/lib/crypto
diff options
context:
space:
mode:
authorOri Bernstein <ori@markovcorp.com>2018-01-27 12:22:19 -0800
committerOri Bernstein <ori@markovcorp.com>2018-01-27 12:23:36 -0800
commit4c94aae21c2c2aec19d4fd5871cfe92bc09303a7 (patch)
treeb7c773a2274cb3b3ee46d9e90d54a3b6c4ddce37 /lib/crypto
parentdbe9ae0f9dbed30d40952261384b4673766d83ca (diff)
downloadmc-4c94aae21c2c2aec19d4fd5871cfe92bc09303a7.tar.gz
Remove std.sleq
We have std.eq. We still export a generic sleq for compatibility, but we don't need it or want it.
Diffstat (limited to 'lib/crypto')
-rw-r--r--lib/crypto/test/aes.myr8
-rw-r--r--lib/crypto/test/chacha20.myr4
-rw-r--r--lib/crypto/test/md5.myr2
-rw-r--r--lib/crypto/test/sha1.myr2
-rw-r--r--lib/crypto/test/sha256.myr2
-rw-r--r--lib/crypto/test/sha3.myr16
-rw-r--r--lib/crypto/test/sha512.myr2
-rw-r--r--lib/crypto/util.myr2
8 files changed, 19 insertions, 19 deletions
diff --git a/lib/crypto/test/aes.myr b/lib/crypto/test/aes.myr
index 1ad9036..5d3da89 100644
--- a/lib/crypto/test/aes.myr
+++ b/lib/crypto/test/aes.myr
@@ -40,7 +40,7 @@ const enctest = {t : aestest
crypto.aeskeysched(&ctx, t.key)
crypto.aesencrypt(&ctx, t.inp[:], out[:])
- if !std.sleq(out[:], t.out[:])
+ if !std.eq(out[:], t.out[:])
std.fatal("test failed: got {r}, expected {r}\n", out[:], t.out[:])
;;
}
@@ -51,7 +51,7 @@ const dectest = {t : aestest
crypto.aeskeysched(&ctx, t.key)
crypto.aesdecrypt(&ctx, t.inp[:], out[:])
- if !std.sleq(out[:], t.out[:])
+ if !std.eq(out[:], t.out[:])
std.fatal("test failed: got {r}, expected {r}\n", out[:], t.out[:])
;;
}
@@ -61,7 +61,7 @@ const bigenctest = {t : aestest
crypto.aeskeysched(&ctx, t.key)
crypto.aesencrypt(&ctx, t.inp[:], out[:])
- if !std.sleq(out[:], t.out[:])
+ if !std.eq(out[:], t.out[:])
std.fatal("test failed: got {r}, expected {r}\n", out[:], t.out[:])
;;
}
@@ -72,7 +72,7 @@ const bigdectest = {t : aestest
crypto.aeskeysched(&ctx, t.key)
crypto.aesdecrypt(&ctx, t.inp[:], out[:])
- if !std.sleq(out[:], t.out[:])
+ if !std.eq(out[:], t.out[:])
std.fatal("test failed: got {r}, expected {r}\n", out[:], t.out[:])
;;
}
diff --git a/lib/crypto/test/chacha20.myr b/lib/crypto/test/chacha20.myr
index d271693..3fa25e3 100644
--- a/lib/crypto/test/chacha20.myr
+++ b/lib/crypto/test/chacha20.myr
@@ -854,9 +854,9 @@ const check = {chk
;;
crypto.chacha20encrypt(&st, data[:], result[:])
- std.assert(std.sleq(result[:], chk.stream0), "mismatched stream0")
+ std.assert(std.eq(result[:], chk.stream0), "mismatched stream0")
crypto.chacha20encrypt(&st, data[:], result[:])
- std.assert(std.sleq(result[:], chk.stream1), "mismatched stream1")
+ std.assert(std.eq(result[:], chk.stream1), "mismatched stream1")
}
diff --git a/lib/crypto/test/md5.myr b/lib/crypto/test/md5.myr
index 380c531..c042363 100644
--- a/lib/crypto/test/md5.myr
+++ b/lib/crypto/test/md5.myr
@@ -22,7 +22,7 @@ const hasheq = {got, expected
std.sbfmt(sb, "{p=0,w=2,x}", x)
;;
str = std.sbfin(sb)
- if (!std.sleq(str, expected))
+ if (!std.eq(str, expected))
std.fatal("mismatched hashes:\n\tgot:\t{}\n\texpected:\t{}\n", str, expected)
;;
std.slfree(str)
diff --git a/lib/crypto/test/sha1.myr b/lib/crypto/test/sha1.myr
index 75361f8..0cd3bd8 100644
--- a/lib/crypto/test/sha1.myr
+++ b/lib/crypto/test/sha1.myr
@@ -22,7 +22,7 @@ const hasheq = {got, expected
std.sbfmt(sb, "{p=0,w=2,x}", x)
;;
str = std.sbfin(sb)
- if (!std.sleq(str, expected))
+ if (!std.eq(str, expected))
std.fatal("mismatched hashes:\n\tgot:\t{}\n\texpected:\t{}\n", str, expected)
;;
std.slfree(str)
diff --git a/lib/crypto/test/sha256.myr b/lib/crypto/test/sha256.myr
index 32142d1..9b2e27a 100644
--- a/lib/crypto/test/sha256.myr
+++ b/lib/crypto/test/sha256.myr
@@ -33,7 +33,7 @@ const hasheq = {got, expected
std.sbfmt(sb, "{p=0,w=2,x}", x)
;;
str = std.sbfin(sb)
- if (!std.sleq(str, expected))
+ if (!std.eq(str, expected))
std.fatal("mismatched hashes:\n\tgot:\t{}\n\texpected:\t{}\n", str, expected)
;;
std.slfree(str)
diff --git a/lib/crypto/test/sha3.myr b/lib/crypto/test/sha3.myr
index cf15111..eb7eefd 100644
--- a/lib/crypto/test/sha3.myr
+++ b/lib/crypto/test/sha3.myr
@@ -9,7 +9,7 @@ const main = {
ret = crypto.keccak224("")
testr.check(ctx, \
- std.sleq(\
+ std.eq(\
ret[:], \
"\xf7\x18\x37\x50\x2b\xa8\xe1\x08\x37\xbd\xd8\xd3\x65\xad" \
"\xb8\x55\x91\x89\x56\x02\xfc\x55\x2b\x48\xb7\x39\x0a\xbd"), \
@@ -20,7 +20,7 @@ const main = {
ret = crypto.keccak256("")
testr.check(ctx, \
- std.sleq(\
+ std.eq(\
ret[:], \
"\xC5\xD2\x46\x01\x86\xF7\x23\x3C\x92\x7E\x7D\xB2\xDC\xC7\x03\xC0" \
"\xE5\x00\xB6\x53\xCA\x82\x27\x3B\x7B\xFA\xD8\x04\x5D\x85\xA4\x70"), \
@@ -31,7 +31,7 @@ const main = {
ret = crypto.keccak384("")
testr.check(ctx, \
- std.sleq(\
+ std.eq(\
ret[:], \
"\x2C\x23\x14\x6A\x63\xA2\x9A\xCF" \
"\x99\xE7\x3B\x88\xF8\xC2\x4E\xAA" \
@@ -46,7 +46,7 @@ const main = {
ret = crypto.keccak512("")
testr.check(ctx, \
- std.sleq(\
+ std.eq(\
ret[:], \
"\x0E\xAB\x42\xDE\x4C\x3C\xEB\x92" \
"\x35\xFC\x91\xAC\xFF\xE7\x46\xB2" \
@@ -64,7 +64,7 @@ const main = {
ret = crypto.keccak224("Keccak-224 Test Hash")
testr.check(ctx, \
- std.sleq(\
+ std.eq(\
ret[:], \
"\x30\x04\x5B\x34\x94\x6E\x1B\x2E\x09\x16\x13\x36\x2F\xD2" \
"\x2A\xA0\x8E\x2B\xEA\xFE\xC5\xE8\xDA\xEE\x42\xC2\xE6\x65"), \
@@ -75,7 +75,7 @@ const main = {
ret = crypto.keccak256("Keccak-256 Test Hash")
testr.check(ctx, \
- std.sleq(\
+ std.eq(\
ret[:], \
"\xA8\xD7\x1B\x07\xF4\xAF\x26\xA4\xFF\x21\x02\x7F\x62\xFF\x60\x26" \
"\x7F\xF9\x55\xC9\x63\xF0\x42\xC4\x6D\xA5\x2E\xE3\xCF\xAF\x3D\x3C"), \
@@ -86,7 +86,7 @@ const main = {
ret = crypto.keccak384("Keccak-384 Test Hash")
testr.check(ctx, \
- std.sleq(\
+ std.eq(\
ret[:], \
"\xE2\x13\xFD\x74\xAF\x0C\x5F\xF9" \
"\x1B\x42\x3C\x8B\xCE\xEC\xD7\x01" \
@@ -101,7 +101,7 @@ const main = {
ret = crypto.keccak512("Keccak-512 Test Hash")
testr.check(ctx, \
- std.sleq(\
+ std.eq(\
ret[:], \
"\x96\xEE\x47\x18\xDC\xBA\x3C\x74" \
"\x61\x9B\xA1\xFA\x7F\x57\xDF\xE7" \
diff --git a/lib/crypto/test/sha512.myr b/lib/crypto/test/sha512.myr
index cec12f8..46ef2ba 100644
--- a/lib/crypto/test/sha512.myr
+++ b/lib/crypto/test/sha512.myr
@@ -34,7 +34,7 @@ const hasheq = {got, expected
std.sbfmt(sb, "{p=0,w=2,x}", x)
;;
str = std.sbfin(sb)
- if (!std.sleq(str, expected))
+ if (!std.eq(str, expected))
std.fatal("mismatched hashes:\n\tgot:\t{}\n\texpected:\t{}\n", str, expected)
;;
std.slfree(str)
diff --git a/lib/crypto/util.myr b/lib/crypto/util.myr
index 2170029..e5bd689 100644
--- a/lib/crypto/util.myr
+++ b/lib/crypto/util.myr
@@ -12,7 +12,7 @@ const hasheq = {got, expected
std.sbfmt(sb, "{p=0,w=2,x}", x)
;;
str = std.sbfin(sb)
- if (!std.sleq(str, expected))
+ if (!std.eq(str, expected))
std.fatal("mismatched hashes:\n\tgot:\t{}\n\texpected:\t{}\n", str, expected)
;;
std.slfree(str)