HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulecrypton-1.0.4Haskell2010

Crypto.Cipher.Salsa

  • 1 type
  • 3 values
  • Packagecrypton-1.0.4
  • Exports4
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceSalsa.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 Salsa state

#

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

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

    the current Salsa state

  3. -> ba

    the source to xor with the generator

  4. -> (ba, State)
#

Combine the salsa 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 Salsa state

  3. -> Int

    the length of data to generate

  4. -> (ba, State)
#

Generate a number of bytes from the Salsa output directly