def gather

bend-collections@1.0.0.0 · spec/crypto/sha/packed.bend:69

import bend-collections@1.0.0.0/spec/crypto/sha/packed.bend as Packed
import Base
import bend-collections@1.0.0.0/src/crypto/sha/state.bend as S

69def gather(+extra: Nat,n: Nat, +index: U32, +padding: Bool, +remain: Nat, +total: Nat,
70    s: S.State, acc: List<&2,U32>, pair: Array<U32> & U32) -> Array<U32> & S.State:
71  match n pair:
72    case 0n Tuple{a,w}:
73      (a,compress(prepare(padding,List.reverse(&2,U32,w <> acc),remain,total),extra,s))
74    case 1n+p Tuple{a,w}:
75      gather(extra,p,U32.inc(index),padding,remain,total,s,w <> acc,Array.get(U32,a,U32.inc(index)))

Uses (13)

Used by (35)