Check.hmac_sha256_pieces: def of bend-osdev-crypto@0.1.0.0 Import: import bend-osdev-crypto@0.1.0.0/check.bend as Check Lines 304-308 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=304&end_line=308 import Base import bend-osdev-bytes@0.1.0.0/bytes.bend as B import bend-osdev-crypto@0.1.0.0/hmac.bend as Hm import bend-osdev-crypto@0.1.0.0/inst_sha2.bend as SH # HMAC-SHA-256 in two pieces, and verify of the tag def hmac_sha256_pieces(+k: B.Octets, +a: B.Octets, +b: B.Octets) -> String: +kk = Hm.CrHmac.key(~64n, ~SH.CrSha2.sha256, k) +t = Hm.CrHmac.finish(~SH.CrSha2State, ~SH.CrSha2.init256(), ~SH.CrSha2.update, ~SH.CrSha2.final, Hm.CrHmac.update(~SH.CrSha2State, ~SH.CrSha2.update, Hm.CrHmac.update(~SH.CrSha2State, ~SH.CrSha2.update, Hm.CrHmac.start(~SH.CrSha2State, ~SH.CrSha2.init256(), ~SH.CrSha2.update, kk), a), b)) cat(B.Octets.hex(t), cat(" ", yes_no(Hm.CrHmac.verify(~SH.CrSha2.sha256, kk, B.Octets.append(a, b), t)))) Uses (16): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String 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.hex 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=yes_no https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/hmac.bend&name=CrHmac.finish https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/hmac.bend&name=CrHmac.key https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/hmac.bend&name=CrHmac.start https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/hmac.bend&name=CrHmac.update https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/hmac.bend&name=CrHmac.verify https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/inst_sha2.bend&name=CrSha2.final https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/inst_sha2.bend&name=CrSha2.init256 https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/inst_sha2.bend&name=CrSha2.sha256 https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/inst_sha2.bend&name=CrSha2.update https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/inst_sha2.bend&name=CrSha2State