def regen
import bend-collections-laws-crypto@1.0.0.0/src/crypto/argon2/argon2.bend as Argon2import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/argon2/types.bend as A
160# The address block for position idx: a new one at the segment's first
161# position and at every multiple of 128 (data-independent segments only).
162def regen(need: Bool, addr: A.Block, +r: Nat, +l: Nat, +s: Nat, +mm: Nat, +t: Nat, +idx: Nat) -> A.Block:
163 match need:
164 case True{}:
165 addresses(r, l, s, mm, t, Nat.add(Nat.div(idx, 128n), 1n))
166 case False{}:
167 addr