blakesum-0.3: The BLAKE SHA-3 candidate hashes, in Haskell

Data.Digest.SHA3.Candidate.BLAKE

Contents

Description

Module : Data.Digest.SHA3.Candidate.BLAKE License : BSD-style Maintainer : Kevin Cantu me@kevincantu.org Stability : experimental

| BLAKE is one of the finalists in the NIST SHA-3 hash function competition to replace SHA-1 and SHA-2.

Synopsis

Digests

blake256Source

Arguments

:: ByteString

salt, 16 bytes

-> ByteString

message

-> ByteString

digest, 32 bytes

Compute a BLAKE-256 digest from a given salt and message

blake512Source

Arguments

:: ByteString

salt, 32 bytes

-> ByteString

message

-> ByteString

digest, 64 bytes

Compute a BLAKE-512 digest from a given salt and message

blake224Source

Arguments

:: ByteString

salt, 16 bytes

-> ByteString

message

-> ByteString

digest, 28 bytes

Compute a BLAKE-224 digest from a given salt and message (trucates output of a BLAKE-256)

blake384Source

Arguments

:: ByteString

salt, 32 bytes

-> ByteString

message

-> ByteString

digest, 48 bytes

Compute a BLAKE-384 digest from a given salt and message (trucates output of a BLAKE-512)

Simple display

textDigest :: ByteString -> TextSource

Convert a digest (or other ByteString) to hexadecimal digits | For example, to compute a digest of a message, 0x00, using BLAKE-512 (faster on 64 bit systems), with a salt of 0, and get the digits in hex:

 import Data.Digest.SHA3.Candidate.BLAKE
 import qualified Data.ByteString.Lazy as B

 textDigest $ blake512 (B.take 32 $ B.repeat 0) (B.singleton 0)