def next
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
77# the next 64-bit output (a refill always yields a nonempty buffer)
78def next(g: ChaCha8) -> W.U64 & ChaCha8:
79 match g:
80 case C{+k, p, buf}:
81 match buf:
82 case Con{x, rest}:
83 (x, C{k, p, rest})
84 case Nil{}:
85 pop(refill(k, p))
Uses (7)
Used by (14)
- bend-collections-laws-crypto@1.0.0.0/src/crypto/random:next
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/random/bytes:outs
- bend-collections-laws-crypto@1.0.0.0/spec/math/random:map_outputs
- bend-collections-laws-crypto@1.0.0.0/src/crypto/random:take1
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/random/proof:gen_outputs
- …