def copy.words
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytesimport Base
70# n words from src[s..] to dst[d..] (word indexes).
71def copy.words(n: Nat, r: Array<U32> & U32, dst: Array<U32>, +s: U32, +d: U32) -> Array<U32> & Array<U32>:
72 match n:
73 case 0n:
74 (a, w) = r
75 (a, dst)
76 case 1n+p:
77 (a, +w) = r
78 copy.words(p, Array.get(U32, a, (s + 1 : U32)), Array.set(U32, dst, d, w), (s + 1 : U32), (d + 1 : U32))