def final_go

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

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

317# C = B[0][q-1] XOR .. XOR B[p-1][q-1]: pair holds the memory and B[l][q-1],
318# n more lanes follow.
319def final_go(n: Nat, +l: Nat, +q: Nat, c: A.Block, pair: Array<U32> & A.Block) -> A.Block:
320  match n pair:
321    case 0n Tuple{a, b}:
322      G.xor(c, b)
323    case 1n+rest Tuple{a, b}:
324      final_go(rest, Nat.add(l, 1n), q, G.xor(c, b), M.get(Nat.add(Nat.mul(Nat.add(l, 1n), q), Nat.sub(q, 1n)), a))

Uses (11)

Used by (1)