Chacha.blocks: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha.bend as Chacha Lines 143-150 of bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha.bend&start_line=143&end_line=150 import Base # The plaintext cut into 64-byte blocks; the last one may be shorter (and # there is none for the empty plaintext). fuel bounds the number of blocks # (the length of the plaintext is enough). def blocks(fuel: Nat, +xs: List<&2, U32>) -> List<&2, List<&2, U32>>: match fuel xs: case 0n _: Nil{} case 1n+p Nil{}: Nil{} case 1n+p x <> rest: prefix(64n, x <> rest) <> blocks(p, suffix(64n, x <> rest)) Uses (5): 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=bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha.bend&name=prefix https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha.bend&name=suffix