Pbkdf2.cr.pbkdf2.out: def of bend-osdev-crypto@0.1.0.0 Import: import bend-osdev-crypto@0.1.0.0/pbkdf2.bend as Pbkdf2 Lines 65-77 of bend-osdev-crypto@0.1.0.0/pbkdf2.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-crypto@0.1.0.0/pbkdf2.bend&start_line=65&end_line=77 import Base import bend-osdev-bytes@0.1.0.0/bytes.bend as B # n more bytes: the rest of the current block cur, then T_(i+1), T_(i+2), ... # (a MAC whose tags are empty gives zeros) def cr.pbkdf2.out(~K: Data, ~compute: K -> B.Octets -> B.Octets, n: Nat, cur: List<&2, U32>, +k: K, +salt: B.Octets, +c: Nat, +i: U32) -> List<&2, U32>: match n: case 0n: Nil{} case 1n+p: match cur: case Con{h, t}: Con{h, cr.pbkdf2.out(~K, ~compute, p, t, k, salt, c, i)} case Nil{}: +blk = cr.pbkdf2.block(~K, ~compute, k, salt, c, U32.add(i, 1)) Con{cr.pbkdf2.head(blk), cr.pbkdf2.out(~K, ~compute, p, cr.pbkdf2.tail(blk), k, salt, c, U32.add(i, 1))} Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add 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/pbkdf2.bend&name=cr.pbkdf2.block https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/pbkdf2.bend&name=cr.pbkdf2.head https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/pbkdf2.bend&name=cr.pbkdf2.tail