Check.michael_mac.of: def of bend-osdev-crypto@0.1.0.0 Import: import bend-osdev-crypto@0.1.0.0/check.bend as Check Lines 365-373 of bend-osdev-crypto@0.1.0.0/check.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-crypto@0.1.0.0/check.bend&start_line=365&end_line=373 import Base import bend-osdev-bytes@0.1.0.0/bytes.bend as B import bend-osdev-crypto@0.1.0.0/crypto.bend as Cr import bend-osdev-crypto@0.1.0.0/inst_michael.bend as MIC import bend-osdev-hashes@0.1.0.0/hashes.bend as Hs import bend-osdev-hashes@0.1.0.0/michael.bend as HMI # Michael through the MAC interface: the tag, verify of it, and of it with # its first byte changed def michael_mac.of(r: Result<&2, &2, Cr.CrError, Hs.HsW2>, +m: B.Octets) -> String: match r: case Fail{e}: err(e) case Done{+k}: +t = HMI.HsMichael.mic(k, m) cat(B.Octets.hex(t), cat(" ", cat(yes_no(MIC.CrMichael.verify(k, m, t)), cat(" ", yes_no(MIC.CrMichael.verify(k, m, B.Octets.append(B.Octets.of_list([U32.xor(cr.check.first(t), 1)]), B.Octets.drop(1n, t)))))))) Uses (17): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.xor https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets.append https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets.drop https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets.hex https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets.of_list https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/check.bend&name=cat https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/check.bend&name=cr.check.first https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/check.bend&name=err https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/check.bend&name=yes_no https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/crypto.bend&name=CrError https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/inst_michael.bend&name=CrMichael.verify https://jend.leeeet.dev/definition.txt?path=bend-osdev-hashes@0.1.0.0/hashes.bend&name=HsW2 https://jend.leeeet.dev/definition.txt?path=bend-osdev-hashes@0.1.0.0/michael.bend&name=HsMichael.mic