raaz-0.2.1: The raaz cryptographic library.

Safe Haskell | None
Language | Haskell2010

Raaz.Hash.Sha512

Contents

- The SHA512 cryptographic hash
- HMAC computation using SHA512

Description

This module exposes combinators to compute the SHA512 hash and the associated HMAC for some common types.

Synopsis

- data SHA512
- sha512 :: PureByteSource src => src -> SHA512
- sha512File :: FilePath -> IO SHA512
- sha512Source :: ByteSource src => src -> IO SHA512
- hmacSha512 :: PureByteSource src => Key (HMAC SHA512) -> src -> HMAC SHA512
- hmacSha512File :: Key (HMAC SHA512) -> FilePath -> IO (HMAC SHA512)
- hmacSha512Source :: ByteSource src => Key (HMAC SHA512) -> src -> IO (HMAC SHA512)

# The SHA512 cryptographic hash

data SHA512 Source #

The Sha512 hash value. Used in implementation of Sha384 as well.

Instances

Eq SHA512 Source # |
Instance details Defined in Raaz.Hash.Sha512.Internal Methods (==) :: SHA512 -> SHA512 -> Bool Source # (/=) :: SHA512 -> SHA512 -> Bool Source #
Show SHA512 Source # |
Instance details Defined in Raaz.Hash.Sha512.Internal Methods showsPrec :: Int -> SHA512 -> ShowS Source # show :: SHA512 -> String Source # showList :: [SHA512] -> ShowS Source #
IsString SHA512 Source # |
Instance details Defined in Raaz.Hash.Sha512.Internal Methods fromString :: String -> SHA512 Source #
Storable SHA512 Source # |

Instance details

Defined in Raaz.Hash.Sha512.Internal

Methods

sizeOf :: SHA512 -> Int Source #

alignment :: SHA512 -> Int Source #

peekElemOff :: Ptr SHA512 -> Int -> IO SHA512 Source #

pokeElemOff :: Ptr SHA512 -> Int -> SHA512 -> IO () Source #

peekByteOff :: Ptr b -> Int -> IO SHA512 Source #

pokeByteOff :: Ptr b -> Int -> SHA512 -> IO () Source #

peek :: Ptr SHA512 -> IO SHA512 Source #

poke :: Ptr SHA512 -> SHA512 -> IO () Source #

Equality SHA512 Source # |
Instance details Defined in Raaz.Hash.Sha512.Internal Methods eq :: SHA512 -> SHA512 -> Result Source #
EndianStore SHA512 Source # |
Instance details Defined in Raaz.Hash.Sha512.Internal Methods store :: Ptr SHA512 -> SHA512 -> IO () Source # load :: Ptr SHA512 -> IO SHA512 Source # adjustEndian :: Ptr SHA512 -> Int -> IO () Source #
Encodable SHA512 Source # |
Instance details Defined in Raaz.Hash.Sha512.Internal Methods toByteString :: SHA512 -> ByteString Source # fromByteString :: ByteString -> Maybe SHA512 Source # unsafeFromByteString :: ByteString -> SHA512 Source #
Recommendation SHA512 Source # | Recommend implementation for SHA512.
Instance details Defined in Raaz.Hash.Sha512.Recommendation Methods recommended :: SHA512 -> Implementation SHA512 Source #
Primitive SHA512 Source # |
Instance details Defined in Raaz.Hash.Sha512.Internal Associated Types type Implementation SHA512 :: Type Source # Methods blockSize :: SHA512 -> BYTES Int Source #
Hash SHA512 Source # |
Instance details Defined in Raaz.Hash.Sha512.Internal Methods additionalPadBlocks :: SHA512 -> BLOCKS SHA512 Source #
Initialisable (HashMemory SHA512) () Source # |
Instance details Defined in Raaz.Hash.Sha512.Internal Methods initialise :: () -> MT (HashMemory SHA512) () Source #
type Implementation SHA512 Source # |
Instance details Defined in Raaz.Hash.Sha512.Internal type Implementation SHA512 = SomeHashI SHA512

sha512 :: PureByteSource src => src -> SHA512 Source #

Compute the sha512 hash of an instance of `PureByteSource`. Use this for computing the sha512 hash of a strict or lazy byte string.

sha512File :: FilePath -> IO SHA512 Source #

Compute the sha512 hash of a file.

sha512Source :: ByteSource src => src -> IO SHA512 Source #

Compute the sha512 hash of a general byte source.

# HMAC computation using SHA512

hmacSha512 Source #

Arguments

:: PureByteSource src |
=> Key (HMAC SHA512) | Key to use
-> src | pure source whose hmac is to be computed
-> HMAC SHA512 |

Compute the message authentication code using hmac-sha512.

hmacSha512File Source #

Arguments

:: Key (HMAC SHA512) | Key to use
-> FilePath | File whose hmac is to be computed
-> IO (HMAC SHA512) |

Compute the message authentication code for a file.

hmacSha512Source :: ByteSource src => Key (HMAC SHA512) -> src -> IO (HMAC SHA512) Source #

Compute the message authetication code for a generic byte source.