moonbitstack/moonrand/chacha does not have a README file

    ChaCha12

    pub struct ChaCha12 {
    // private fields
    }

    impl Rng for ChaCha12
    impl Secure for ChaCha12
    impl Seeded for ChaCha12

    ChaCha12::advance

    fn ChaCha12::advance(self : ChaCha12, n : UInt64) -> Unit

    Skip the next n 64-bit draws.

    ChaCha12::fill

    fn ChaCha12::fill(self : ChaCha12, buf : FixedArray[Byte]) -> Unit

    ChaCha12::from_seed

    fn ChaCha12::from_seed(seed : BytesView) -> ChaCha12

    ChaCha12::new

    fn ChaCha12::new(seed : BytesView) -> ChaCha12

    ChaCha12::next_u32

    fn ChaCha12::next_u32(self : ChaCha12) -> UInt

    ChaCha12::next_u64

    fn ChaCha12::next_u64(self : ChaCha12) -> UInt64

    ChaCha12::seed_size

    fn ChaCha12::seed_size() -> Int

    ChaCha12::with_nonce

    fn ChaCha12::with_nonce(seed : BytesView, nonce0 : UInt, nonce1 : UInt, nonce2 : UInt, ctr : UInt) -> ChaCha12

    ChaCha20

    pub struct ChaCha20 {
    // private fields
    }

    impl Rng for ChaCha20
    impl Secure for ChaCha20
    impl Seeded for ChaCha20

    ChaCha20::advance

    fn ChaCha20::advance(self : ChaCha20, n : UInt64) -> Unit

    Skip the next n 64-bit draws.

    ChaCha20::fill

    fn ChaCha20::fill(self : ChaCha20, buf : FixedArray[Byte]) -> Unit

    ChaCha20::from_seed

    fn ChaCha20::from_seed(seed : BytesView) -> ChaCha20

    ChaCha20::new

    fn ChaCha20::new(seed : BytesView) -> ChaCha20

    ChaCha20::next_u32

    fn ChaCha20::next_u32(self : ChaCha20) -> UInt

    ChaCha20::next_u64

    fn ChaCha20::next_u64(self : ChaCha20) -> UInt64

    ChaCha20::seed_size

    fn ChaCha20::seed_size() -> Int

    ChaCha20::with_nonce

    fn ChaCha20::with_nonce(seed : BytesView, nonce0 : UInt, nonce1 : UInt, nonce2 : UInt, ctr : UInt) -> ChaCha20

    ChaCha8

    pub struct ChaCha8 {
    // private fields
    }

    ChaCha: a 256-bit-key stream cipher, used here as a generator. The three variants differ only in round count; the 12-round form is the library default. The cipher follows RFC 8439 exactly (32-bit block counter in state word 12, 96-bit nonce in words 13-15); gen_vectors checks its keystream against the RFC test vectors.

    State lives in interior-mutable Array buffers and a priv mut counter, so next_u64 advances the generator through a by-value Self.
    impl Rng for ChaCha8
    impl Secure for ChaCha8
    impl Seeded for ChaCha8

    ChaCha8::advance

    fn ChaCha8::advance(self : ChaCha8, n : UInt64) -> Unit

    Skip the next n 64-bit draws. The counter names the block, so this is a seek rather than a march: advance costs the same for one draw as for 2^40.

    ChaCha8::fill

    fn ChaCha8::fill(self : ChaCha8, buf : FixedArray[Byte]) -> Unit

    ChaCha8::from_seed

    fn ChaCha8::from_seed(seed : BytesView) -> ChaCha8

    ChaCha8::new

    fn ChaCha8::new(seed : BytesView) -> ChaCha8

    ChaCha8::next_u32

    fn ChaCha8::next_u32(self : ChaCha8) -> UInt

    ChaCha8::next_u64

    fn ChaCha8::next_u64(self : ChaCha8) -> UInt64

    ChaCha8::seed_size

    fn ChaCha8::seed_size() -> Int

    ChaCha8::with_nonce

    fn ChaCha8::with_nonce(seed : BytesView, nonce0 : UInt, nonce1 : UInt, nonce2 : UInt, ctr : UInt) -> ChaCha8

    Source Files

    Powered by MoonBit

    Site sourceReport issueModulesSkillsBuild queueStatistics

    © 2026 mooncakes.io