def pop
import bend-collections-laws-crypto@1.0.0.0/src/math/random/chacha8.bend as Chacha8import Base
import bend-collections-laws-crypto@1.0.0.0/src/math/u64.bend as W
68def pop(g: ChaCha8) -> W.U64 & ChaCha8:
69 match g:
70 case C{k, p, buf}:
71 match buf:
72 case Con{x, rest}:
73 (x, C{k, p, rest})
74 case Nil{}:
75 (zero(), C{k, p, []})