salsa20-0.1.0.0
Copyright(c) Alfredo Garcia 2023
LicenseMIT
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hash

Description

This module encapsulates the Salsa20 core function and introduces what is referred to as the hash or salsa20 expressions.

The core function performs cryptographic operations by applying the doubleround function iteratively for a specified number of rounds. The salsa20 expression extends the core expression by reducing the input from 64 to 16 using littleendian functions and then augmenting the result back to 64.

Exported functions:

  • coreCompute: Computes numeric values for the core expression.
  • coreDisplay: Generates string representations of the core expression.
  • coreKeelung: Performs Keelung-specific computations for the core expression.
  • salsa20Compute: Computes numeric values for the salsa20 expression.
  • salsa20Display: Generates string representations of the salsa20 expression.
  • salsa20Keelung: Performs Keelung-specific computations for the salsa20 expression.
  • salsa20powerCompute: Executes the salsa20 function a specified number of times.
Synopsis

Documentation

coreCompute :: Int -> [Word32] -> [Word32] #

The core expression computed.

coreDisplay :: Int -> [String] -> [String] #

The core expression as a string.

coreKeelung :: Int -> [UInt 32] -> Comp [UInt 32] #

The core Keelung expression computed.

salsa20Compute :: Int -> [Word32] -> [Word32] #

The salsa20 expression computed.

salsa20Display :: Int -> [String] -> [String] #

The salsa20 expression as a string using coreDisplay. Call with r = 1, which is one round of doubleround.

salsa20Keelung :: [UInt 32] -> Comp [UInt 32] #

The salsa20 Keelung expression computed. {- salsa20Keelung :: { i:[_] | (len i) == 64 } -> Comp { o:[_] | (len o) == 64 } -}

salsa20powerCompute :: [Word32] -> Int -> [Word32] #

Execute salsa20 a specified number of times, this is not part of the protocol and just used in a test case.