def step

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

import bend-collections@1.0.0.0/src/crypto/argon2/argon2.bend as Argon2
import Base
import bend-collections@1.0.0.0/src/crypto/argon2/types.bend as A
import bend-collections@1.0.0.0/src/crypto/argon2/blamka.bend as G
import bend-collections@1.0.0.0/src/crypto/argon2/memory.bend as M

251# One block: pair holds the memory and the previous block.
252def step(+r: Nat, +l: Nat, +s: Nat, +idx: Nat, +p: Nat, +q: Nat, +sl: Nat, +cur: Nat, +indep: Bool, +addr: A.Block, pair: Array<U32> & A.Block) -> Array<U32>:
253  (a, +prev) = pair
254  +r0 = Nat.is_eq(r, 0n)
255  +pr = pick(indep, addr, idx, prev)
256  +rl = ref_lane(Bool.and(r0, Nat.is_eq(s, 0n)), l, hi(pr), p)
257  +w = area(area_base(r0, s, sl, q), idx, Nat.is_eq(rl, l))
258  +ri = Nat.mod(Nat.add(start(r0, s, sl), rel(w, G.lo(pr))), q)
259  with_ref(r0, cur, prev, M.get(Nat.add(Nat.mul(rl, q), ri), a))

Uses (22)

Used by (1)