raaz-0.3.10: Fast and type safe cryptography.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Blake2b.CPortable

Description

The portable C-implementation of Blake2b.

Synopsis

Documentation

type Prim = Blake2b Source #

type Internals = Blake2bMem Source #

type BufferPtr = AlignedBlockPtr BufferAlignment Prim Source #

additionalBlocks :: BlockCount Blake2b Source #

processBlocks :: BufferPtr -> BlockCount Blake2b -> Blake2bMem -> IO () Source #

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

Process the last bytes. The last block of the message (whether it is padded or not) should necessarily be processed by the processLast function as one needs to set the finalisation flag for it.

Let us consider two cases.

  1. The message is empty. In which case the padding is 1-block size. This needs to be processed as the last block
  2. If the message is non-empty then the padded message is the least multiple n of block size that is greater than or equal to the input and hence is at least 1 block in size. Therefore, we should be compressing a total n-1 blocks using the block compression function at the last block using the finalisation flags.