Safe Haskell | None |
---|---|
Language | Haskell2010 |
An implementation for simple MAC which is based on a cryptographic hash. This construction is safe only for certain hashes like blake2 and therefore should not be used indiscriminately. In particular, sha2 hashes should not be used in this mode as they are prone to length extension attack.
If you want to use sha2 hashs for message authentication, you should make use of the more complicated HMAC construction.
Synopsis
- type Prim = Keyed Prim
- name :: String
- description :: String
- data Internals
- type BufferAlignment = BufferAlignment
- type BufferPtr = AlignedBlockPtr BufferAlignment Prim
- processBlocks :: BufferPtr -> BlockCount Prim -> Internals -> IO ()
- processLast :: BufferPtr -> BYTES Int -> Internals -> IO ()
- additionalBlocks :: BlockCount Prim
- data family Key p
Documentation
description :: String Source #
Description of the implementation.
The internal memory used by the implementation.
Instances
Memory Internals Source # | |
Defined in Mac.Implementation memoryAlloc :: Alloc Internals unsafeToPointer :: Internals -> Ptr Word8 | |
Extractable Internals Prim Source # | |
Defined in Mac.Implementation | |
Initialisable Internals (Key (Keyed Prim)) Source # | |
Defined in Mac.Implementation initialise :: Key (Keyed Prim) -> Internals -> IO () |
type BufferAlignment = BufferAlignment Source #
type BufferPtr = AlignedBlockPtr BufferAlignment Prim Source #
processBlocks :: BufferPtr -> BlockCount Prim -> Internals -> IO () Source #
The function that process bytes in multiples of the block size of the primitive.
processLast :: BufferPtr -> BYTES Int -> Internals -> IO () Source #
Process the last bytes of the stream.
additionalBlocks :: BlockCount Prim Source #
The additional space required in the buffer for processing the data.
Instances
Initialisable Internals (Key (Keyed Prim)) | |
Defined in Mac.Implementation initialise :: Key (Keyed Prim) -> Internals -> IO () | |
Show (Key (Keyed prim)) | |
IsString (Key (Keyed prim)) | |
Defined in Raaz.Primitive.Keyed.Internal fromString :: String -> Key (Keyed prim) # | |
Encodable (Key (Keyed prim)) | |
Defined in Raaz.Primitive.Keyed.Internal toByteString :: Key (Keyed prim) -> ByteString fromByteString :: ByteString -> Maybe (Key (Keyed prim)) unsafeFromByteString :: ByteString -> Key (Keyed prim) | |
newtype Key (Keyed prim) | |
Defined in Raaz.Primitive.Keyed.Internal |