| Copyright | (c) 2024 Jared Tobin |
|---|---|
| License | MIT |
| Maintainer | Jared Tobin <jared@ppad.tech> |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Crypto.Hash.SHA512
Description
Synopsis
- hash :: ByteString -> ByteString
- hash_lazy :: ByteString -> ByteString
- hmac :: ByteString -> ByteString -> ByteString
- hmac_lazy :: ByteString -> ByteString -> ByteString
SHA-512 message digest functions
hash :: ByteString -> ByteString Source #
Compute a condensed representation of a strict bytestring via SHA-512.
The 512-bit output digest is returned as a strict bytestring.
>>>hash "strict bytestring input""<strict 512-bit message digest>"
hash_lazy :: ByteString -> ByteString Source #
Compute a condensed representation of a lazy bytestring via SHA-512.
The 512-bit output digest is returned as a strict bytestring.
>>>hash_lazy "lazy bytestring input""<strict 512-bit message digest>"
SHA512-based MAC functions
Arguments
| :: ByteString | key |
| -> ByteString | text |
| -> ByteString |
Produce a message authentication code for a strict bytestring, based on the provided (strict, bytestring) key, via SHA-512.
The 512-bit MAC is returned as a strict bytestring.
Per RFC 2104, the key should be a minimum of 64 bytes long. Keys exceeding 1024 bytes in length will first be hashed (via SHA-512).
>>>hmac "strict bytestring key" "strict bytestring input""<strict 512-bit MAC>"
Arguments
| :: ByteString | key |
| -> ByteString | text |
| -> ByteString |
Produce a message authentication code for a lazy bytestring, based on the provided (strict, bytestring) key, via SHA-512.
The 512-bit MAC is returned as a strict bytestring.
Per RFC 2104, the key should be a minimum of 64 bytes long. Keys exceeding 1024 bytes in length will first be hashed (via SHA-512).
>>>hmac_lazy "strict bytestring key" "lazy bytestring input""<strict 512-bit MAC>"