def regen

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/argon2/argon2.bend:230

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/argon2/argon2.bend as Argon2
import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/argon2/types.bend as A

230# In a data-independent segment a new address block is computed for the
231# segment's first position and at every multiple of 128, with counter
232# idx / 128 + 1 (the i-th address block has counter i).
233def regen(need: Bool, addr: A.Block, +r: Nat, +l: Nat, +s: Nat, +mm: Nat, +t: Nat, +idx: Nat) -> A.Block:
234  match need:
235    case True{}:
236      addresses(r, l, s, mm, t, Nat.add(Nat.div(idx, 128n), 1n))
237    case False{}:
238      addr

Uses (6)

Used by (4)