type ChaCha8 … // NewChaCha8 returns a new ChaCha8 seeded with the given seed. func NewChaCha8(seed [32]byte) *ChaCha8 { … } // Seed resets the ChaCha8 to behave the same way as NewChaCha8(seed). func (c *ChaCha8) Seed(seed [32]byte) { … } // Uint64 returns a uniformly distributed random uint64 value. func (c *ChaCha8) Uint64() uint64 { … } // Read reads exactly len(p) bytes into p. // It always returns len(p) and a nil error. // // If calls to Read and Uint64 are interleaved, the order in which bits are // returned by the two is undefined, and Read may return bits generated before // the last call to Uint64. func (c *ChaCha8) Read(p []byte) (n int, err error) { … } // UnmarshalBinary implements the [encoding.BinaryUnmarshaler] interface. func (c *ChaCha8) UnmarshalBinary(data []byte) error { … } func cutPrefix(s, prefix []byte) (after []byte, found bool) { … } func readUint8LengthPrefixed(b []byte) (buf, rest []byte, ok bool) { … } // AppendBinary implements the [encoding.BinaryAppender] interface. func (c *ChaCha8) AppendBinary(b []byte) ([]byte, error) { … } // MarshalBinary implements the [encoding.BinaryMarshaler] interface. func (c *ChaCha8) MarshalBinary() ([]byte, error) { … }