def rd

bend-collections@1.0.0.0 · src/crypto/argon2/memory.bend:11

import bend-collections@1.0.0.0/src/crypto/argon2/memory.bend as Memory
import Base

11# Words i - n .. i, prepended to acc: pair holds the memory and word i.
12def rd(n: Nat, +i: Nat, acc: List<&2, U32>, pair: Array<U32> & U32) -> Array<U32> & List<&2, U32>:
13  match n pair:
14    case 0n Tuple{a, w}:
15      (a, w <> acc)
16    case 1n+p Tuple{a, w}:
17      +j = Nat.sub(i, 1n)
18      rd(p, j, w <> acc, Array.get(U32, a, U32.from_nat(j)))

Uses (9)

Used by (1)