ppad-ripemd160-0.1.3: The RIPEMD-160 hashing algorithm.
Copyright(c) 2024 Jared Tobin
LicenseMIT
MaintainerJared Tobin <jared@ppad.tech>
Safe HaskellNone
LanguageHaskell2010

Crypto.Hash.RIPEMD160

Description

Pure RIPEMD-160 and HMAC-RIPEMD160 implementations for strict and lazy ByteStrings.

Synopsis

RIPEMD-160 message digest functions

hash :: ByteString -> ByteString Source #

Compute a condensed representation of a strict bytestring via RIPEMD-160.

The 160-bit output digest is returned as a strict bytestring.

>>> hash "strict bytestring input"
"<strict 160-bit message digest>"

hash_lazy :: ByteString -> ByteString Source #

Compute a condensed representation of a lazy bytestring via RIPEMD-160.

The 160-bit output digest is returned as a strict bytestring.

>>> hash_lazy "lazy bytestring input"
"<strict 160-bit message digest>"

RIPEMD160-based MAC functions

hmac Source #

Arguments

:: ByteString

key

-> ByteString

text

-> ByteString 

Produce a message authentication code for a strict bytestring, based on the provided (strict, bytestring) key, via RIPEMD-160.

The 160-bit MAC is returned as a strict bytestring.

Per RFC 2104, the key should be a minimum of 20 bytes long. Keys exceeding 64 bytes in length will first be hashed (via RIPEMD-160).

>>> hmac "strict bytestring key" "strict bytestring input"
"<strict 160-bit MAC>"

hmac_lazy Source #

Arguments

:: ByteString

key

-> ByteString

text

-> ByteString 

Produce a message authentication code for a lazy bytestring, based on the provided (strict, bytestring) key, via RIPEMD-160.

The 160-bit MAC is returned as a strict bytestring.

Per RFC 2104, the key should be a minimum of 20 bytes long. Keys exceeding 64 bytes in length will first be hashed (via RIPEMD-160).

>>> hmac_lazy "strict bytestring key" "lazy bytestring input"
"<strict 160-bit MAC>"