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

Mac.Implementation

Description

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

Documentation

type Prim = Keyed Prim Source #

name :: String Source #

Name of the implementation.

description :: String Source #

Description of the implementation.

data Internals Source #

The internal memory used by the implementation.

Instances

Instances details
Memory Internals Source # 
Instance details

Defined in Mac.Implementation

Extractable Internals Prim Source # 
Instance details

Defined in Mac.Implementation

Methods

extract :: Internals -> IO Prim

Initialisable Internals (Key (Keyed Prim)) Source # 
Instance details

Defined in Mac.Implementation

Methods

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.

data family Key p #

Instances

Instances details
Initialisable Internals (Key (Keyed Prim)) 
Instance details

Defined in Mac.Implementation

Methods

initialise :: Key (Keyed Prim) -> Internals -> IO ()

Show (Key (Keyed prim)) 
Instance details

Defined in Raaz.Primitive.Keyed.Internal

Methods

showsPrec :: Int -> Key (Keyed prim) -> ShowS #

show :: Key (Keyed prim) -> String #

showList :: [Key (Keyed prim)] -> ShowS #

IsString (Key (Keyed prim)) 
Instance details

Defined in Raaz.Primitive.Keyed.Internal

Methods

fromString :: String -> Key (Keyed prim) #

Encodable (Key (Keyed prim)) 
Instance details

Defined in Raaz.Primitive.Keyed.Internal

Methods

toByteString :: Key (Keyed prim) -> ByteString

fromByteString :: ByteString -> Maybe (Key (Keyed prim))

unsafeFromByteString :: ByteString -> Key (Keyed prim)

newtype Key (Keyed prim) 
Instance details

Defined in Raaz.Primitive.Keyed.Internal

newtype Key (Keyed prim) = Key ByteString