Kbkdf.CrKbkdf.counter_kdf: def of bend-osdev-crypto@0.1.0.0 Import: import bend-osdev-crypto@0.1.0.0/kbkdf.bend as Kbkdf Lines 113-117 of bend-osdev-crypto@0.1.0.0/kbkdf.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-crypto@0.1.0.0/kbkdf.bend&start_line=113&end_line=117 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 # K_OUT of n bytes in counter mode over the MAC (~K, ~key, ~compute) with # hlen-byte tags, an r = 8 rlen bit counter and an llen-byte [L]_2 def CrKbkdf.counter_kdf(~K: Data, ~key: B.Octets -> Result<&2, &2, Cr.CrError, K>, ~compute: K -> B.Octets -> B.Octets, ~hlen: Nat, ~rlen: Nat, ~llen: Nat, ki: B.Octets, label: B.Octets, context: B.Octets, +n: Nat) -> Result<&2, &2, Cr.CrError, B.Octets>: +max = Nat.sub(Nat.pow(2n, Nat.mul(8n, rlen)), 1n) cr.kb.checked(~K, ~compute, ~rlen, cr.kb.fits(hlen, llen, n, max), key(ki), CrKbkdf.fixed(~llen, label, context, n), n) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.pow https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result 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-crypto@0.1.0.0/crypto.bend&name=CrError https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/kbkdf.bend&name=CrKbkdf.fixed https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/kbkdf.bend&name=cr.kb.checked https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/kbkdf.bend&name=cr.kb.fits