check.bend
bend-osdev-hashes@0.1.0.0 · 147 lines · 9 definitions
1
2
3
4
5
6
7
8
9
10
11import Base
12import bend-osdev-bytes@0.1.0.0/bytes.bend as B
13import bend-osdev-hashes@0.1.0.0/hashes.bend as Hs
14import bend-osdev-hashes@0.1.0.0/md4.bend as M4
15import bend-osdev-hashes@0.1.0.0/md5.bend as M5
16import bend-osdev-hashes@0.1.0.0/sha1.bend as S1
17import bend-osdev-hashes@0.1.0.0/ripemd160.bend as RM
18import bend-osdev-hashes@0.1.0.0/sm3.bend as SM
19import bend-osdev-hashes@0.1.0.0/streebog.bend as ST
20import bend-osdev-hashes@0.1.0.0/michael.bend as MI
21
22
23def third(+o: B.Octets) -> Nat:
24 Nat.div(B.Octets.len(o), 3n)
25
26def p1(+o: B.Octets) -> B.Octets:
27 B.Octets.take(third(o), o)
28
29def p2(+o: B.Octets) -> B.Octets:
30 B.Octets.take(third(o), B.Octets.drop(third(o), o))
31
32def p3(+o: B.Octets) -> B.Octets:
33 B.Octets.drop(Nat.mul(2n, third(o)), o)
34
35def 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
44def mic(k: B.Octets, m: B.Octets) -> String:
45 mic.of(MI.HsMichael.key(k), m)
46
47
48def 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
55def million_a() -> B.Octets:
56 B.Octets.of_list(as.go(1000000n, Nil{}))
57
58def main() -> IO(Unit):
59 +big = million_a()
60 do IO<Unit>:
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147