check.bend source
check.bend on the hub · documented module
# Generated by gen/check.py; do not edit by hand.## Every hash on its specification's vectors, through the public interface:# the digest in one call, then the same message fed in three pieces# (init, three updates, final). Then Streebog's transformations on RFC# 6986's example 1, a million bytes "a" through SHA-1 and RIPEMD-160, and# Michael on the six vectors recalled as the standard's (each key the# previous tag; unverified, README.md), on IEEE 802.11-2012 M.6.3's TKIP# frame (as hostap's wlantest/test_vectors.c gives it), with a# short key refused. The values are the specifications' (the #| lines).import Baseimport bend-osdev-bytes@0.1.0.0/bytes.bend as Bimport ./hashes.bend as Hsimport ./md4.bend as M4import ./md5.bend as M5import ./sha1.bend as S1import ./ripemd160.bend as RMimport ./sm3.bend as SMimport ./streebog.bend as STimport ./michael.bend as MI# a byte string in three pieces: [0, n/3), [n/3, 2n/3), [2n/3, n)def third(+o: B.Octets) -> Nat: Nat.div(B.Octets.len(o), 3n)def p1(+o: B.Octets) -> B.Octets: B.Octets.take(third(o), o)def p2(+o: B.Octets) -> B.Octets: B.Octets.take(third(o), B.Octets.drop(third(o), o))def p3(+o: B.Octets) -> B.Octets: B.Octets.drop(Nat.mul(2n, third(o)), o)def mic.of(r: Result<&2, &2, Hs.HsError, Hs.HsW2>, +m: B.Octets) -> String: match r: case Done{+k}: 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)))) case Fail{e}: match e: case Hs.HsBadKeyLength{n}: "bad key length " ++ U32.show(U32.from_nat(n))def mic(k: B.Octets, m: B.Octets) -> String: mic.of(MI.HsMichael.key(k), m)# n bytes "a", built tail-recursivelydef as.go(n: Nat, acc: List<&2, U32>) -> List<&2, U32>: match n: case 0n: acc case 1n+p: as.go(p, Con{97, acc})def million_a() -> B.Octets: B.Octets.of_list(as.go(1000000n, Nil{}))def main() -> IO(Unit): +big = million_a() do IO<Unit>: 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("")))))) 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")))))) 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")))))) 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")))))) 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")))))) 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")))))) 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")))))) 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("")))))) 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")))))) 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")))))) 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")))))) 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")))))) 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")))))) 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")))))) 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")))))) 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")))))) 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("")))))) 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")))))) 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")))))) 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")))))) 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")))))) 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")))))) 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")))))) 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")))))) 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")))))) 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")))))) 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")))))) 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")))))) 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])))))) 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])))))) IO.print("streebog lps(0) " ++ B.Octets.hex(ST.HsStreebog.lps(B.Octets.zeros(64n)))) 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])))) 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])))) IO.print("sha1 million a " ++ B.Octets.hex(S1.HsSha1.digest(big))) IO.print("ripemd160 million a " ++ B.Octets.hex(RM.HsRipemd160.digest(big))) IO.print("michael 0000000000000000 " ++ mic(B.Octets.of_list([0, 0, 0, 0, 0, 0, 0, 0]), B.Octets.of_string(""))) IO.print("michael 82925c1ca1d130b8 " ++ mic(B.Octets.of_list([130, 146, 92, 28, 161, 209, 48, 184]), B.Octets.of_string("M"))) IO.print("michael 434721ca40639b3f " ++ mic(B.Octets.of_list([67, 71, 33, 202, 64, 99, 155, 63]), B.Octets.of_string("Mi"))) IO.print("michael e8f9becae97e5d29 " ++ mic(B.Octets.of_list([232, 249, 190, 202, 233, 126, 93, 41]), B.Octets.of_string("Mic"))) IO.print("michael 90038fc6cf13c1db " ++ mic(B.Octets.of_list([144, 3, 143, 198, 207, 19, 193, 219]), B.Octets.of_string("Mich"))) IO.print("michael d55e100510128986 " ++ mic(B.Octets.of_list([213, 94, 16, 5, 16, 18, 137, 134]), B.Octets.of_string("Michael"))) 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]))) IO.print("michael short key: " ++ mic(B.Octets.zeros(7n), B.Octets.empty()))#|md4 0 31d6cfe0d16ae931b73c59d7e0c089c0 31d6cfe0d16ae931b73c59d7e0c089c0#|md4 1 bde52cb31de33e46245e05fbdbd6fb24 bde52cb31de33e46245e05fbdbd6fb24#|md4 3 a448017aaf21d8525fc10ae87aa6729d a448017aaf21d8525fc10ae87aa6729d#|md4 14 d9130a8164549fe818874806e1c7014b d9130a8164549fe818874806e1c7014b#|md4 26 d79e1c308aa5bbcdeea8ed63df412da9 d79e1c308aa5bbcdeea8ed63df412da9#|md4 62 043f8582f241db351ce627e153e7f0e4 043f8582f241db351ce627e153e7f0e4#|md4 80 e33b4ddc9c38f2199c3e7b164fcc0536 e33b4ddc9c38f2199c3e7b164fcc0536#|md5 0 d41d8cd98f00b204e9800998ecf8427e d41d8cd98f00b204e9800998ecf8427e#|md5 1 0cc175b9c0f1b6a831c399e269772661 0cc175b9c0f1b6a831c399e269772661#|md5 3 900150983cd24fb0d6963f7d28e17f72 900150983cd24fb0d6963f7d28e17f72#|md5 14 f96b697d7cb7938d525a2f31aaf161d0 f96b697d7cb7938d525a2f31aaf161d0#|md5 26 c3fcd3d76192e4007dfb496cca67e13b c3fcd3d76192e4007dfb496cca67e13b#|md5 62 d174ab98d277d9f5a5611c2c9f419d9f d174ab98d277d9f5a5611c2c9f419d9f#|md5 80 57edf4a22be3c955ac49da2e2107b67a 57edf4a22be3c955ac49da2e2107b67a#|sha1 3 a9993e364706816aba3e25717850c26c9cd0d89d a9993e364706816aba3e25717850c26c9cd0d89d#|sha1 56 84983e441c3bd26ebaae4aa1f95129e5e54670f1 84983e441c3bd26ebaae4aa1f95129e5e54670f1#|ripemd160 0 9c1185a5c5e9fc54612808977ee8f548b2258d31 9c1185a5c5e9fc54612808977ee8f548b2258d31#|ripemd160 1 0bdc9d2d256b3ee9daae347be6f4dc835a467ffe 0bdc9d2d256b3ee9daae347be6f4dc835a467ffe#|ripemd160 3 8eb208f7e05d987a9b044a8e98c6b087f15a0bfc 8eb208f7e05d987a9b044a8e98c6b087f15a0bfc#|ripemd160 14 5d0689ef49d2fae572b881b123a85ffa21595f36 5d0689ef49d2fae572b881b123a85ffa21595f36#|ripemd160 26 f71c27109c692c1b56bbdceb5b9d2865b3708dbc f71c27109c692c1b56bbdceb5b9d2865b3708dbc#|ripemd160 56 12a053384a9c0c88e405a06c27dcf49ada62eb2b 12a053384a9c0c88e405a06c27dcf49ada62eb2b#|ripemd160 62 b0e20b6e3116640286ed3a87a5713079b21f5189 b0e20b6e3116640286ed3a87a5713079b21f5189#|ripemd160 80 9b752e45573d4b39f4dbd3323cab82bf63326bfb 9b752e45573d4b39f4dbd3323cab82bf63326bfb#|sm3 3 66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0 66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0#|sm3 64 debe9ff92275b8a138604889c18e5a4d6fdb70e5387e5765293dcba39c0c5732 debe9ff92275b8a138604889c18e5a4d6fdb70e5387e5765293dcba39c0c5732#|streebog512 63 1b54d01a4af5b9d5cc3d86d68d285462b19abc2475222f35c085122be4ba1ffa00ad30f8767b3a82384c6574f024c311e2a481332b08ef7f41797891c1646f48 1b54d01a4af5b9d5cc3d86d68d285462b19abc2475222f35c085122be4ba1ffa00ad30f8767b3a82384c6574f024c311e2a481332b08ef7f41797891c1646f48#|streebog256 63 9d151eefd8590b89daa6ba6cb74af9275dd051026bb149a452fd84e5e57b5500 9d151eefd8590b89daa6ba6cb74af9275dd051026bb149a452fd84e5e57b5500#|streebog512 72 1e88e62226bfca6f9994f1f2d51569e0daf8475a3b0fe61a5300eee46d961376035fe83549ada2b8620fcd7c496ce5b33f0cb9dddc2b6460143b03dabac9fb28 1e88e62226bfca6f9994f1f2d51569e0daf8475a3b0fe61a5300eee46d961376035fe83549ada2b8620fcd7c496ce5b33f0cb9dddc2b6460143b03dabac9fb28#|streebog256 72 9dd2fe4e90409e5da87f53976d7405b0c0cac628fc669a741d50063c557e8f50 9dd2fe4e90409e5da87f53976d7405b0c0cac628fc669a741d50063c557e8f50#|streebog lps(0) 74a5d4ce2efc83b374a5d4ce2efc83b374a5d4ce2efc83b374a5d4ce2efc83b374a5d4ce2efc83b374a5d4ce2efc83b374a5d4ce2efc83b374a5d4ce2efc83b3#|streebog g_N(0, M1) e2da3b6b73e4fe05d9f5b13f793541955c81502c520fedd3c5babb8c90f65427bd8e7333db8a4826a6a95a444166a817384f3921af34ea9111cb2c81f82c10fd#|streebog g_0(h, 504) 7c1d77e75d1a90a80145d362d6e137907f6ea6194fa147216294376d9db62d3d5297d5d46770bbaaeb16170b2a6f0242b6140dc2fee4c296f15c6924d91f885c#|sha1 million a 34aa973cd4c4daa4f61eeb2bdbad27316534016f#|ripemd160 million a 52783243c1697bdbe16d37f97f68f08325dc1528#|michael 0000000000000000 82925c1ca1d130b8 82925c1ca1d130b8#|michael 82925c1ca1d130b8 434721ca40639b3f 434721ca40639b3f#|michael 434721ca40639b3f e8f9becae97e5d29 e8f9becae97e5d29#|michael e8f9becae97e5d29 90038fc6cf13c1db 90038fc6cf13c1db#|michael 90038fc6cf13c1db d55e100510128986 d55e100510128986#|michael d55e100510128986 0a942b124ecaa546 0a942b124ecaa546#|michael tkip m.6.3 6881a3f3d648d03c 6881a3f3d648d03c#|michael short key: bad key length 7