def key_of
bend-collections-laws-math@1.0.0.0 · src/math/random/chacha8.bend:100
import bend-collections-laws-math@1.0.0.0/src/math/random/chacha8.bend as Chacha8
import Base
import bend-collections-laws-math@1.0.0.0/src/math/random/chacha8/block.bend as B
100def key_of(bs: List<&2, U32>) -> Maybe<&2, B.Key>:
101 match bs:
102 case [a0, a1, a2, a3, b0, b1, b2, b3, c0, c1, c2, c3, d0, d1, d2, d3, e0, e1, e2, e3, f0, f1, f2, f3, g0, g1, g2, g3, h0, h1, h2, h3]:
103 Some{B.K{le32(a0, a1, a2, a3), le32(b0, b1, b2, b3), le32(c0, c1, c2, c3), le32(d0, d1, d2, d3), le32(e0, e1, e2, e3), le32(f0, f1, f2, f3), le32(g0, g1, g2, g3), le32(h0, h1, h2, h3)}}
104 case _:
105 None{}