def hp_go
bend-collections@1.0.0.0 · src/crypto/argon2/argon2.bend:27
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/blake/blake2b/sized.bend as H
27
28
29
30
31def hp_go(n: Nat, v: List<&2, U32>, +last: Nat) -> List<&2, U32>:
32 match n v:
33 case _ Nil{}:
34 Nil{}
35 case 0n +x <> +r:
36 cat(List.take(&2, U32, x <> r, 32n), H.hash(last, x <> r))
37 case 1n+p +x <> +r:
38 cat(List.take(&2, U32, x <> r, 32n), hp_go(p, H.hash(64n, x <> r), last))