raaz-0.3.2: Fast and type safe cryptography.
Safe HaskellNone
LanguageHaskell2010

ChaCha20.CPortable

Description

The portable C-implementation of Blake2b.

Synopsis

Documentation

type Prim = ChaCha20 Source #

type Internals = ChaCha20Mem Source #

type BufferPtr = AlignedBlockPtr BufferAlignment Prim Source #

additionalBlocks :: BlockCount ChaCha20 Source #

processBlocks :: BufferPtr -> BlockCount Prim -> Internals -> IO () Source #

processLast :: BufferPtr -> BYTES Int -> Internals -> IO () Source #

Process the last bytes.

xchacha20Setup :: Nounce XChaCha20 -> Internals -> IO () Source #

The xchacha20Setup does the following to the internal state

  1. Replaces the key stored in the keyCell using the hchacah20 hashing function
  2. Initialises the ivcell with the last two words in the xiv value.

As a result the internal state is ready to start encrypting using the xchacha20 variant.

copyKey :: Dest ChaCha20Mem -> Src (MemoryCell (Key ChaCha20)) -> IO () Source #

Copy the key from the memory cell chacha20Mem.

runBlockProcess :: (Ptr buf -> Word64 -> Ptr a -> Ptr b -> Ptr c -> IO ()) -> BufferPtr -> BlockCount Prim -> Internals -> IO () Source #