HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulecryptonite-0.30Haskell2010

Crypto.Cipher.ChaCha

  • 2 types
  • 5 values
  • Packagecryptonite-0.30
  • Exports7
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceChaCha.hs
valueinitialize
  1. :: (ByteArrayAccess key, ByteArrayAccess nonce)
  2. => Int

    number of rounds (8,12,20)

  3. -> key

    the key (128 or 256 bits)

  4. -> nonce

    the nonce (64 or 96 bits)

  5. -> State

    the initial ChaCha state

#

Initialize a new ChaCha context with the number of rounds, the key and the nonce associated.

valuecombine
  1. :: ByteArray ba
  2. => State

    the current ChaCha state

  3. -> ba

    the source to xor with the generator

  4. -> (ba, State)
#

Combine the chacha output and an arbitrary message with a xor, and return the combined output and the new state.

valuegenerate
  1. :: ByteArray ba
  2. => State

    the current ChaCha state

  3. -> Int

    the length of data to generate

  4. -> (ba, State)
#

Generate a number of bytes from the ChaCha output directly

newtypenewtype State
#

ChaCha context

Instances1NFData
  • NFData StateDefined in cryptonite-0.30 · Crypto.Cipher.ChaCha

Simple interface for DRG purpose

3 declarations
newtypenewtype StateSimple
#

ChaCha context for DRG purpose (see Crypto.Random.ChaChaDRG)

Instances1NFData