1 # Generated by gen/check.py; do not edit by hand. 2 # 3 # Every hash on its specification's vectors, through the public interface: 4 # the digest in one call, then the same message fed in three pieces 5 # (init, three updates, final). Then Streebog's transformations on RFC 6 # 6986's example 1, a million bytes "a" through SHA-1 and RIPEMD-160, and 7 # Michael on the six vectors recalled as the standard's (each key the 8 # previous tag; unverified, README.md), on IEEE 802.11-2012 M.6.3's TKIP 9 # frame (as hostap's wlantest/test_vectors.c gives it), with a 10 # short key refused. The values are the specifications' (the #| lines). 11 import Base 12 import bend-osdev-bytes@0.1.0.0/bytes.bend as B 13 import ./hashes.bend as Hs 14 import ./md4.bend as M4 15 import ./md5.bend as M5 16 import ./sha1.bend as S1 17 import ./ripemd160.bend as RM 18 import ./sm3.bend as SM 19 import ./streebog.bend as ST 20 import ./michael.bend as MI 21 22 # a byte string in three pieces: [0, n/3), [n/3, 2n/3), [2n/3, n) 23 def third(+o: B.Octets) -> Nat: 24 Nat.div(B.Octets.len(o), 3n) 25 26 def p1(+o: B.Octets) -> B.Octets: 27 B.Octets.take(third(o), o) 28 29 def p2(+o: B.Octets) -> B.Octets: 30 B.Octets.take(third(o), B.Octets.drop(third(o), o)) 31 32 def p3(+o: B.Octets) -> B.Octets: 33 B.Octets.drop(Nat.mul(2n, third(o)), o) 34 35 def mic.of(r: Result<&2, &2, Hs.HsError, Hs.HsW2>, +m: B.Octets) -> String: 36 match r: 37 case Done{+k}: 38 B.Octets.hex(MI.HsMichael.mic(k, m)) ++ " " ++ B.Octets.hex(MI.HsMichael.final(MI.HsMichael.update(MI.HsMichael.update(MI.HsMichael.update(MI.HsMichael.init(k), p1(m)), p2(m)), p3(m)))) 39 case Fail{e}: 40 match e: 41 case Hs.HsBadKeyLength{n}: 42 "bad key length " ++ U32.show(U32.from_nat(n)) 43 44 def mic(k: B.Octets, m: B.Octets) -> String: 45 mic.of(MI.HsMichael.key(k), m) 46 47 # n bytes "a", built tail-recursively 48 def as.go(n: Nat, acc: List<&2, U32>) -> List<&2, U32>: 49 match n: 50 case 0n: 51 acc 52 case 1n+p: 53 as.go(p, Con{97, acc}) 54 55 def million_a() -> B.Octets: 56 B.Octets.of_list(as.go(1000000n, Nil{})) 57 58 def main() -> IO(Unit): 59 +big = million_a() 60 do IO: 61 IO.print("md4 0 " ++ B.Octets.hex(M4.HsMd4.digest(B.Octets.of_string(""))) ++ " " ++ B.Octets.hex(M4.HsMd4.final(M4.HsMd4.update(M4.HsMd4.update(M4.HsMd4.update(M4.HsMd4.init(), p1(B.Octets.of_string(""))), p2(B.Octets.of_string(""))), p3(B.Octets.of_string("")))))) 62 IO.print("md4 1 " ++ B.Octets.hex(M4.HsMd4.digest(B.Octets.of_string("a"))) ++ " " ++ B.Octets.hex(M4.HsMd4.final(M4.HsMd4.update(M4.HsMd4.update(M4.HsMd4.update(M4.HsMd4.init(), p1(B.Octets.of_string("a"))), p2(B.Octets.of_string("a"))), p3(B.Octets.of_string("a")))))) 63 IO.print("md4 3 " ++ B.Octets.hex(M4.HsMd4.digest(B.Octets.of_string("abc"))) ++ " " ++ B.Octets.hex(M4.HsMd4.final(M4.HsMd4.update(M4.HsMd4.update(M4.HsMd4.update(M4.HsMd4.init(), p1(B.Octets.of_string("abc"))), p2(B.Octets.of_string("abc"))), p3(B.Octets.of_string("abc")))))) 64 IO.print("md4 14 " ++ B.Octets.hex(M4.HsMd4.digest(B.Octets.of_string("message digest"))) ++ " " ++ B.Octets.hex(M4.HsMd4.final(M4.HsMd4.update(M4.HsMd4.update(M4.HsMd4.update(M4.HsMd4.init(), p1(B.Octets.of_string("message digest"))), p2(B.Octets.of_string("message digest"))), p3(B.Octets.of_string("message digest")))))) 65 IO.print("md4 26 " ++ B.Octets.hex(M4.HsMd4.digest(B.Octets.of_string("abcdefghijklmnopqrstuvwxyz"))) ++ " " ++ B.Octets.hex(M4.HsMd4.final(M4.HsMd4.update(M4.HsMd4.update(M4.HsMd4.update(M4.HsMd4.init(), p1(B.Octets.of_string("abcdefghijklmnopqrstuvwxyz"))), p2(B.Octets.of_string("abcdefghijklmnopqrstuvwxyz"))), p3(B.Octets.of_string("abcdefghijklmnopqrstuvwxyz")))))) 66 IO.print("md4 62 " ++ B.Octets.hex(M4.HsMd4.digest(B.Octets.of_string("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"))) ++ " " ++ B.Octets.hex(M4.HsMd4.final(M4.HsMd4.update(M4.HsMd4.update(M4.HsMd4.update(M4.HsMd4.init(), p1(B.Octets.of_string("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"))), p2(B.Octets.of_string("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"))), p3(B.Octets.of_string("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")))))) 67 IO.print("md4 80 " ++ B.Octets.hex(M4.HsMd4.digest(B.Octets.of_string("12345678901234567890123456789012345678901234567890123456789012345678901234567890"))) ++ " " ++ B.Octets.hex(M4.HsMd4.final(M4.HsMd4.update(M4.HsMd4.update(M4.HsMd4.update(M4.HsMd4.init(), p1(B.Octets.of_string("12345678901234567890123456789012345678901234567890123456789012345678901234567890"))), p2(B.Octets.of_string("12345678901234567890123456789012345678901234567890123456789012345678901234567890"))), p3(B.Octets.of_string("12345678901234567890123456789012345678901234567890123456789012345678901234567890")))))) 68 IO.print("md5 0 " ++ B.Octets.hex(M5.HsMd5.digest(B.Octets.of_string(""))) ++ " " ++ B.Octets.hex(M5.HsMd5.final(M5.HsMd5.update(M5.HsMd5.update(M5.HsMd5.update(M5.HsMd5.init(), p1(B.Octets.of_string(""))), p2(B.Octets.of_string(""))), p3(B.Octets.of_string("")))))) 69 IO.print("md5 1 " ++ B.Octets.hex(M5.HsMd5.digest(B.Octets.of_string("a"))) ++ " " ++ B.Octets.hex(M5.HsMd5.final(M5.HsMd5.update(M5.HsMd5.update(M5.HsMd5.update(M5.HsMd5.init(), p1(B.Octets.of_string("a"))), p2(B.Octets.of_string("a"))), p3(B.Octets.of_string("a")))))) 70 IO.print("md5 3 " ++ B.Octets.hex(M5.HsMd5.digest(B.Octets.of_string("abc"))) ++ " " ++ B.Octets.hex(M5.HsMd5.final(M5.HsMd5.update(M5.HsMd5.update(M5.HsMd5.update(M5.HsMd5.init(), p1(B.Octets.of_string("abc"))), p2(B.Octets.of_string("abc"))), p3(B.Octets.of_string("abc")))))) 71 IO.print("md5 14 " ++ B.Octets.hex(M5.HsMd5.digest(B.Octets.of_string("message digest"))) ++ " " ++ B.Octets.hex(M5.HsMd5.final(M5.HsMd5.update(M5.HsMd5.update(M5.HsMd5.update(M5.HsMd5.init(), p1(B.Octets.of_string("message digest"))), p2(B.Octets.of_string("message digest"))), p3(B.Octets.of_string("message digest")))))) 72 IO.print("md5 26 " ++ B.Octets.hex(M5.HsMd5.digest(B.Octets.of_string("abcdefghijklmnopqrstuvwxyz"))) ++ " " ++ B.Octets.hex(M5.HsMd5.final(M5.HsMd5.update(M5.HsMd5.update(M5.HsMd5.update(M5.HsMd5.init(), p1(B.Octets.of_string("abcdefghijklmnopqrstuvwxyz"))), p2(B.Octets.of_string("abcdefghijklmnopqrstuvwxyz"))), p3(B.Octets.of_string("abcdefghijklmnopqrstuvwxyz")))))) 73 IO.print("md5 62 " ++ B.Octets.hex(M5.HsMd5.digest(B.Octets.of_string("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"))) ++ " " ++ B.Octets.hex(M5.HsMd5.final(M5.HsMd5.update(M5.HsMd5.update(M5.HsMd5.update(M5.HsMd5.init(), p1(B.Octets.of_string("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"))), p2(B.Octets.of_string("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"))), p3(B.Octets.of_string("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")))))) 74 IO.print("md5 80 " ++ B.Octets.hex(M5.HsMd5.digest(B.Octets.of_string("12345678901234567890123456789012345678901234567890123456789012345678901234567890"))) ++ " " ++ B.Octets.hex(M5.HsMd5.final(M5.HsMd5.update(M5.HsMd5.update(M5.HsMd5.update(M5.HsMd5.init(), p1(B.Octets.of_string("12345678901234567890123456789012345678901234567890123456789012345678901234567890"))), p2(B.Octets.of_string("12345678901234567890123456789012345678901234567890123456789012345678901234567890"))), p3(B.Octets.of_string("12345678901234567890123456789012345678901234567890123456789012345678901234567890")))))) 75 IO.print("sha1 3 " ++ B.Octets.hex(S1.HsSha1.digest(B.Octets.of_string("abc"))) ++ " " ++ B.Octets.hex(S1.HsSha1.final(S1.HsSha1.update(S1.HsSha1.update(S1.HsSha1.update(S1.HsSha1.init(), p1(B.Octets.of_string("abc"))), p2(B.Octets.of_string("abc"))), p3(B.Octets.of_string("abc")))))) 76 IO.print("sha1 56 " ++ B.Octets.hex(S1.HsSha1.digest(B.Octets.of_string("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"))) ++ " " ++ B.Octets.hex(S1.HsSha1.final(S1.HsSha1.update(S1.HsSha1.update(S1.HsSha1.update(S1.HsSha1.init(), p1(B.Octets.of_string("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"))), p2(B.Octets.of_string("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"))), p3(B.Octets.of_string("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq")))))) 77 IO.print("ripemd160 0 " ++ B.Octets.hex(RM.HsRipemd160.digest(B.Octets.of_string(""))) ++ " " ++ B.Octets.hex(RM.HsRipemd160.final(RM.HsRipemd160.update(RM.HsRipemd160.update(RM.HsRipemd160.update(RM.HsRipemd160.init(), p1(B.Octets.of_string(""))), p2(B.Octets.of_string(""))), p3(B.Octets.of_string("")))))) 78 IO.print("ripemd160 1 " ++ B.Octets.hex(RM.HsRipemd160.digest(B.Octets.of_string("a"))) ++ " " ++ B.Octets.hex(RM.HsRipemd160.final(RM.HsRipemd160.update(RM.HsRipemd160.update(RM.HsRipemd160.update(RM.HsRipemd160.init(), p1(B.Octets.of_string("a"))), p2(B.Octets.of_string("a"))), p3(B.Octets.of_string("a")))))) 79 IO.print("ripemd160 3 " ++ B.Octets.hex(RM.HsRipemd160.digest(B.Octets.of_string("abc"))) ++ " " ++ B.Octets.hex(RM.HsRipemd160.final(RM.HsRipemd160.update(RM.HsRipemd160.update(RM.HsRipemd160.update(RM.HsRipemd160.init(), p1(B.Octets.of_string("abc"))), p2(B.Octets.of_string("abc"))), p3(B.Octets.of_string("abc")))))) 80 IO.print("ripemd160 14 " ++ B.Octets.hex(RM.HsRipemd160.digest(B.Octets.of_string("message digest"))) ++ " " ++ B.Octets.hex(RM.HsRipemd160.final(RM.HsRipemd160.update(RM.HsRipemd160.update(RM.HsRipemd160.update(RM.HsRipemd160.init(), p1(B.Octets.of_string("message digest"))), p2(B.Octets.of_string("message digest"))), p3(B.Octets.of_string("message digest")))))) 81 IO.print("ripemd160 26 " ++ B.Octets.hex(RM.HsRipemd160.digest(B.Octets.of_string("abcdefghijklmnopqrstuvwxyz"))) ++ " " ++ B.Octets.hex(RM.HsRipemd160.final(RM.HsRipemd160.update(RM.HsRipemd160.update(RM.HsRipemd160.update(RM.HsRipemd160.init(), p1(B.Octets.of_string("abcdefghijklmnopqrstuvwxyz"))), p2(B.Octets.of_string("abcdefghijklmnopqrstuvwxyz"))), p3(B.Octets.of_string("abcdefghijklmnopqrstuvwxyz")))))) 82 IO.print("ripemd160 56 " ++ B.Octets.hex(RM.HsRipemd160.digest(B.Octets.of_string("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"))) ++ " " ++ B.Octets.hex(RM.HsRipemd160.final(RM.HsRipemd160.update(RM.HsRipemd160.update(RM.HsRipemd160.update(RM.HsRipemd160.init(), p1(B.Octets.of_string("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"))), p2(B.Octets.of_string("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"))), p3(B.Octets.of_string("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq")))))) 83 IO.print("ripemd160 62 " ++ B.Octets.hex(RM.HsRipemd160.digest(B.Octets.of_string("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"))) ++ " " ++ B.Octets.hex(RM.HsRipemd160.final(RM.HsRipemd160.update(RM.HsRipemd160.update(RM.HsRipemd160.update(RM.HsRipemd160.init(), p1(B.Octets.of_string("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"))), p2(B.Octets.of_string("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"))), p3(B.Octets.of_string("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")))))) 84 IO.print("ripemd160 80 " ++ B.Octets.hex(RM.HsRipemd160.digest(B.Octets.of_string("12345678901234567890123456789012345678901234567890123456789012345678901234567890"))) ++ " " ++ B.Octets.hex(RM.HsRipemd160.final(RM.HsRipemd160.update(RM.HsRipemd160.update(RM.HsRipemd160.update(RM.HsRipemd160.init(), p1(B.Octets.of_string("12345678901234567890123456789012345678901234567890123456789012345678901234567890"))), p2(B.Octets.of_string("12345678901234567890123456789012345678901234567890123456789012345678901234567890"))), p3(B.Octets.of_string("12345678901234567890123456789012345678901234567890123456789012345678901234567890")))))) 85 IO.print("sm3 3 " ++ B.Octets.hex(SM.HsSm3.digest(B.Octets.of_string("abc"))) ++ " " ++ B.Octets.hex(SM.HsSm3.final(SM.HsSm3.update(SM.HsSm3.update(SM.HsSm3.update(SM.HsSm3.init(), p1(B.Octets.of_string("abc"))), p2(B.Octets.of_string("abc"))), p3(B.Octets.of_string("abc")))))) 86 IO.print("sm3 64 " ++ B.Octets.hex(SM.HsSm3.digest(B.Octets.of_string("abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"))) ++ " " ++ B.Octets.hex(SM.HsSm3.final(SM.HsSm3.update(SM.HsSm3.update(SM.HsSm3.update(SM.HsSm3.init(), p1(B.Octets.of_string("abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"))), p2(B.Octets.of_string("abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"))), p3(B.Octets.of_string("abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd")))))) 87 IO.print("streebog512 63 " ++ B.Octets.hex(ST.HsStreebog.digest512(B.Octets.of_string("012345678901234567890123456789012345678901234567890123456789012"))) ++ " " ++ B.Octets.hex(ST.HsStreebog.final512(ST.HsStreebog.update(ST.HsStreebog.update(ST.HsStreebog.update(ST.HsStreebog.init512(), p1(B.Octets.of_string("012345678901234567890123456789012345678901234567890123456789012"))), p2(B.Octets.of_string("012345678901234567890123456789012345678901234567890123456789012"))), p3(B.Octets.of_string("012345678901234567890123456789012345678901234567890123456789012")))))) 88 IO.print("streebog256 63 " ++ B.Octets.hex(ST.HsStreebog.digest256(B.Octets.of_string("012345678901234567890123456789012345678901234567890123456789012"))) ++ " " ++ B.Octets.hex(ST.HsStreebog.final256(ST.HsStreebog.update(ST.HsStreebog.update(ST.HsStreebog.update(ST.HsStreebog.init256(), p1(B.Octets.of_string("012345678901234567890123456789012345678901234567890123456789012"))), p2(B.Octets.of_string("012345678901234567890123456789012345678901234567890123456789012"))), p3(B.Octets.of_string("012345678901234567890123456789012345678901234567890123456789012")))))) 89 IO.print("streebog512 72 " ++ B.Octets.hex(ST.HsStreebog.digest512(B.Octets.of_list([209, 229, 32, 226, 229, 242, 240, 232, 44, 32, 209, 242, 240, 232, 225, 238, 230, 232, 32, 226, 237, 243, 246, 232, 44, 32, 226, 229, 254, 242, 250, 32, 241, 32, 236, 238, 240, 255, 32, 241, 242, 240, 229, 235, 224, 236, 232, 32, 237, 224, 32, 245, 240, 224, 225, 240, 251, 255, 32, 239, 235, 250, 234, 251, 32, 200, 227, 238, 240, 229, 226, 251]))) ++ " " ++ B.Octets.hex(ST.HsStreebog.final512(ST.HsStreebog.update(ST.HsStreebog.update(ST.HsStreebog.update(ST.HsStreebog.init512(), p1(B.Octets.of_list([209, 229, 32, 226, 229, 242, 240, 232, 44, 32, 209, 242, 240, 232, 225, 238, 230, 232, 32, 226, 237, 243, 246, 232, 44, 32, 226, 229, 254, 242, 250, 32, 241, 32, 236, 238, 240, 255, 32, 241, 242, 240, 229, 235, 224, 236, 232, 32, 237, 224, 32, 245, 240, 224, 225, 240, 251, 255, 32, 239, 235, 250, 234, 251, 32, 200, 227, 238, 240, 229, 226, 251]))), p2(B.Octets.of_list([209, 229, 32, 226, 229, 242, 240, 232, 44, 32, 209, 242, 240, 232, 225, 238, 230, 232, 32, 226, 237, 243, 246, 232, 44, 32, 226, 229, 254, 242, 250, 32, 241, 32, 236, 238, 240, 255, 32, 241, 242, 240, 229, 235, 224, 236, 232, 32, 237, 224, 32, 245, 240, 224, 225, 240, 251, 255, 32, 239, 235, 250, 234, 251, 32, 200, 227, 238, 240, 229, 226, 251]))), p3(B.Octets.of_list([209, 229, 32, 226, 229, 242, 240, 232, 44, 32, 209, 242, 240, 232, 225, 238, 230, 232, 32, 226, 237, 243, 246, 232, 44, 32, 226, 229, 254, 242, 250, 32, 241, 32, 236, 238, 240, 255, 32, 241, 242, 240, 229, 235, 224, 236, 232, 32, 237, 224, 32, 245, 240, 224, 225, 240, 251, 255, 32, 239, 235, 250, 234, 251, 32, 200, 227, 238, 240, 229, 226, 251])))))) 90 IO.print("streebog256 72 " ++ B.Octets.hex(ST.HsStreebog.digest256(B.Octets.of_list([209, 229, 32, 226, 229, 242, 240, 232, 44, 32, 209, 242, 240, 232, 225, 238, 230, 232, 32, 226, 237, 243, 246, 232, 44, 32, 226, 229, 254, 242, 250, 32, 241, 32, 236, 238, 240, 255, 32, 241, 242, 240, 229, 235, 224, 236, 232, 32, 237, 224, 32, 245, 240, 224, 225, 240, 251, 255, 32, 239, 235, 250, 234, 251, 32, 200, 227, 238, 240, 229, 226, 251]))) ++ " " ++ B.Octets.hex(ST.HsStreebog.final256(ST.HsStreebog.update(ST.HsStreebog.update(ST.HsStreebog.update(ST.HsStreebog.init256(), p1(B.Octets.of_list([209, 229, 32, 226, 229, 242, 240, 232, 44, 32, 209, 242, 240, 232, 225, 238, 230, 232, 32, 226, 237, 243, 246, 232, 44, 32, 226, 229, 254, 242, 250, 32, 241, 32, 236, 238, 240, 255, 32, 241, 242, 240, 229, 235, 224, 236, 232, 32, 237, 224, 32, 245, 240, 224, 225, 240, 251, 255, 32, 239, 235, 250, 234, 251, 32, 200, 227, 238, 240, 229, 226, 251]))), p2(B.Octets.of_list([209, 229, 32, 226, 229, 242, 240, 232, 44, 32, 209, 242, 240, 232, 225, 238, 230, 232, 32, 226, 237, 243, 246, 232, 44, 32, 226, 229, 254, 242, 250, 32, 241, 32, 236, 238, 240, 255, 32, 241, 242, 240, 229, 235, 224, 236, 232, 32, 237, 224, 32, 245, 240, 224, 225, 240, 251, 255, 32, 239, 235, 250, 234, 251, 32, 200, 227, 238, 240, 229, 226, 251]))), p3(B.Octets.of_list([209, 229, 32, 226, 229, 242, 240, 232, 44, 32, 209, 242, 240, 232, 225, 238, 230, 232, 32, 226, 237, 243, 246, 232, 44, 32, 226, 229, 254, 242, 250, 32, 241, 32, 236, 238, 240, 255, 32, 241, 242, 240, 229, 235, 224, 236, 232, 32, 237, 224, 32, 245, 240, 224, 225, 240, 251, 255, 32, 239, 235, 250, 234, 251, 32, 200, 227, 238, 240, 229, 226, 251])))))) 91 IO.print("streebog lps(0) " ++ B.Octets.hex(ST.HsStreebog.lps(B.Octets.zeros(64n)))) 92 IO.print("streebog g_N(0, M1) " ++ B.Octets.hex(ST.HsStreebog.g(B.Octets.zeros(64n), B.Octets.zeros(64n), B.Octets.of_list([48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 1])))) 93 IO.print("streebog g_0(h, 504) " ++ B.Octets.hex(ST.HsStreebog.g(B.Octets.zeros(64n), B.Octets.of_list([226, 218, 59, 107, 115, 228, 254, 5, 217, 245, 177, 63, 121, 53, 65, 149, 92, 129, 80, 44, 82, 15, 237, 211, 197, 186, 187, 140, 144, 246, 84, 39, 189, 142, 115, 51, 219, 138, 72, 38, 166, 169, 90, 68, 65, 102, 168, 23, 56, 79, 57, 33, 175, 52, 234, 145, 17, 203, 44, 129, 248, 44, 16, 253]), B.Octets.of_list([248, 1])))) 94 IO.print("sha1 million a " ++ B.Octets.hex(S1.HsSha1.digest(big))) 95 IO.print("ripemd160 million a " ++ B.Octets.hex(RM.HsRipemd160.digest(big))) 96 IO.print("michael 0000000000000000 " ++ mic(B.Octets.of_list([0, 0, 0, 0, 0, 0, 0, 0]), B.Octets.of_string(""))) 97 IO.print("michael 82925c1ca1d130b8 " ++ mic(B.Octets.of_list([130, 146, 92, 28, 161, 209, 48, 184]), B.Octets.of_string("M"))) 98 IO.print("michael 434721ca40639b3f " ++ mic(B.Octets.of_list([67, 71, 33, 202, 64, 99, 155, 63]), B.Octets.of_string("Mi"))) 99 IO.print("michael e8f9becae97e5d29 " ++ mic(B.Octets.of_list([232, 249, 190, 202, 233, 126, 93, 41]), B.Octets.of_string("Mic"))) 100 IO.print("michael 90038fc6cf13c1db " ++ mic(B.Octets.of_list([144, 3, 143, 198, 207, 19, 193, 219]), B.Octets.of_string("Mich"))) 101 IO.print("michael d55e100510128986 " ++ mic(B.Octets.of_list([213, 94, 16, 5, 16, 18, 137, 134]), B.Octets.of_string("Michael"))) 102 IO.print("michael tkip m.6.3 " ++ mic(B.Octets.of_list([52, 86, 120, 144, 18, 52, 86, 120]), B.Octets.of_list([2, 3, 4, 5, 6, 8, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 170, 170, 3, 0, 0, 0, 8, 0, 69, 0, 0, 84, 0, 0, 64, 0, 64, 1, 165, 85, 192, 168, 10, 2, 192, 168, 10, 1, 8, 0, 58, 176, 0, 0, 0, 0, 205, 76, 5, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55]))) 103 IO.print("michael short key: " ++ mic(B.Octets.zeros(7n), B.Octets.empty())) 104 105 #|md4 0 31d6cfe0d16ae931b73c59d7e0c089c0 31d6cfe0d16ae931b73c59d7e0c089c0 106 #|md4 1 bde52cb31de33e46245e05fbdbd6fb24 bde52cb31de33e46245e05fbdbd6fb24 107 #|md4 3 a448017aaf21d8525fc10ae87aa6729d a448017aaf21d8525fc10ae87aa6729d 108 #|md4 14 d9130a8164549fe818874806e1c7014b d9130a8164549fe818874806e1c7014b 109 #|md4 26 d79e1c308aa5bbcdeea8ed63df412da9 d79e1c308aa5bbcdeea8ed63df412da9 110 #|md4 62 043f8582f241db351ce627e153e7f0e4 043f8582f241db351ce627e153e7f0e4 111 #|md4 80 e33b4ddc9c38f2199c3e7b164fcc0536 e33b4ddc9c38f2199c3e7b164fcc0536 112 #|md5 0 d41d8cd98f00b204e9800998ecf8427e d41d8cd98f00b204e9800998ecf8427e 113 #|md5 1 0cc175b9c0f1b6a831c399e269772661 0cc175b9c0f1b6a831c399e269772661 114 #|md5 3 900150983cd24fb0d6963f7d28e17f72 900150983cd24fb0d6963f7d28e17f72 115 #|md5 14 f96b697d7cb7938d525a2f31aaf161d0 f96b697d7cb7938d525a2f31aaf161d0 116 #|md5 26 c3fcd3d76192e4007dfb496cca67e13b c3fcd3d76192e4007dfb496cca67e13b 117 #|md5 62 d174ab98d277d9f5a5611c2c9f419d9f d174ab98d277d9f5a5611c2c9f419d9f 118 #|md5 80 57edf4a22be3c955ac49da2e2107b67a 57edf4a22be3c955ac49da2e2107b67a 119 #|sha1 3 a9993e364706816aba3e25717850c26c9cd0d89d a9993e364706816aba3e25717850c26c9cd0d89d 120 #|sha1 56 84983e441c3bd26ebaae4aa1f95129e5e54670f1 84983e441c3bd26ebaae4aa1f95129e5e54670f1 121 #|ripemd160 0 9c1185a5c5e9fc54612808977ee8f548b2258d31 9c1185a5c5e9fc54612808977ee8f548b2258d31 122 #|ripemd160 1 0bdc9d2d256b3ee9daae347be6f4dc835a467ffe 0bdc9d2d256b3ee9daae347be6f4dc835a467ffe 123 #|ripemd160 3 8eb208f7e05d987a9b044a8e98c6b087f15a0bfc 8eb208f7e05d987a9b044a8e98c6b087f15a0bfc 124 #|ripemd160 14 5d0689ef49d2fae572b881b123a85ffa21595f36 5d0689ef49d2fae572b881b123a85ffa21595f36 125 #|ripemd160 26 f71c27109c692c1b56bbdceb5b9d2865b3708dbc f71c27109c692c1b56bbdceb5b9d2865b3708dbc 126 #|ripemd160 56 12a053384a9c0c88e405a06c27dcf49ada62eb2b 12a053384a9c0c88e405a06c27dcf49ada62eb2b 127 #|ripemd160 62 b0e20b6e3116640286ed3a87a5713079b21f5189 b0e20b6e3116640286ed3a87a5713079b21f5189 128 #|ripemd160 80 9b752e45573d4b39f4dbd3323cab82bf63326bfb 9b752e45573d4b39f4dbd3323cab82bf63326bfb 129 #|sm3 3 66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0 66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0 130 #|sm3 64 debe9ff92275b8a138604889c18e5a4d6fdb70e5387e5765293dcba39c0c5732 debe9ff92275b8a138604889c18e5a4d6fdb70e5387e5765293dcba39c0c5732 131 #|streebog512 63 1b54d01a4af5b9d5cc3d86d68d285462b19abc2475222f35c085122be4ba1ffa00ad30f8767b3a82384c6574f024c311e2a481332b08ef7f41797891c1646f48 1b54d01a4af5b9d5cc3d86d68d285462b19abc2475222f35c085122be4ba1ffa00ad30f8767b3a82384c6574f024c311e2a481332b08ef7f41797891c1646f48 132 #|streebog256 63 9d151eefd8590b89daa6ba6cb74af9275dd051026bb149a452fd84e5e57b5500 9d151eefd8590b89daa6ba6cb74af9275dd051026bb149a452fd84e5e57b5500 133 #|streebog512 72 1e88e62226bfca6f9994f1f2d51569e0daf8475a3b0fe61a5300eee46d961376035fe83549ada2b8620fcd7c496ce5b33f0cb9dddc2b6460143b03dabac9fb28 1e88e62226bfca6f9994f1f2d51569e0daf8475a3b0fe61a5300eee46d961376035fe83549ada2b8620fcd7c496ce5b33f0cb9dddc2b6460143b03dabac9fb28 134 #|streebog256 72 9dd2fe4e90409e5da87f53976d7405b0c0cac628fc669a741d50063c557e8f50 9dd2fe4e90409e5da87f53976d7405b0c0cac628fc669a741d50063c557e8f50 135 #|streebog lps(0) 74a5d4ce2efc83b374a5d4ce2efc83b374a5d4ce2efc83b374a5d4ce2efc83b374a5d4ce2efc83b374a5d4ce2efc83b374a5d4ce2efc83b374a5d4ce2efc83b3 136 #|streebog g_N(0, M1) e2da3b6b73e4fe05d9f5b13f793541955c81502c520fedd3c5babb8c90f65427bd8e7333db8a4826a6a95a444166a817384f3921af34ea9111cb2c81f82c10fd 137 #|streebog g_0(h, 504) 7c1d77e75d1a90a80145d362d6e137907f6ea6194fa147216294376d9db62d3d5297d5d46770bbaaeb16170b2a6f0242b6140dc2fee4c296f15c6924d91f885c 138 #|sha1 million a 34aa973cd4c4daa4f61eeb2bdbad27316534016f 139 #|ripemd160 million a 52783243c1697bdbe16d37f97f68f08325dc1528 140 #|michael 0000000000000000 82925c1ca1d130b8 82925c1ca1d130b8 141 #|michael 82925c1ca1d130b8 434721ca40639b3f 434721ca40639b3f 142 #|michael 434721ca40639b3f e8f9becae97e5d29 e8f9becae97e5d29 143 #|michael e8f9becae97e5d29 90038fc6cf13c1db 90038fc6cf13c1db 144 #|michael 90038fc6cf13c1db d55e100510128986 d55e100510128986 145 #|michael d55e100510128986 0a942b124ecaa546 0a942b124ecaa546 146 #|michael tkip m.6.3 6881a3f3d648d03c 6881a3f3d648d03c 147 #|michael short key: bad key length 7