def cv_of

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/blake/blake3.bend:60

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/blake/blake3.bend as Blake3
import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/blake/blake3/types.bend as T

60# (Each list consumer below starts by matching its list, so that it stays an
61# unevaluated call on a symbolic list; the Nil cases agree with the general
62# formula, since at(Nil, i) = 0 and put(Nil, i, x) = Nil.)
63def cv_of(+ws: List<&2,U32>) -> T.CV:
64  match ws:
65    case Nil{}: T.CV{0,0,0,0,0,0,0,0}
66    case Con{+x,+r}:
67      +l = {Con{x,r} : List<&2,U32>}
68      T.CV{at(l,0n),at(l,1n),at(l,2n),at(l,3n),at(l,4n),at(l,5n),at(l,6n),at(l,7n)}

Uses (4)

Used by (6)