Safe Haskell | None |
---|---|
Language | Haskell2010 |
The portable C-implementation of Blake2b.
Synopsis
- name :: String
- description :: String
- type Prim = Blake2b
- type Internals = Blake2bMem
- type BufferAlignment = 32
- type BufferPtr = AlignedBlockPtr BufferAlignment Prim
- additionalBlocks :: BlockCount Blake2b
- processBlocks :: BufferPtr -> BlockCount Blake2b -> Blake2bMem -> IO ()
- processLast :: BufferPtr -> BYTES Int -> Blake2bMem -> IO ()
Documentation
description :: String Source #
type BufferAlignment = 32 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.
- The message is empty. In which case the padding is 1-block size. This needs to be processed as the last block
- 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 totaln-1
blocks using the block compression function at the last block using the finalisation flags.