hs-blake2-0.0.2: A cryptohash-inspired library for blake2

Safe HaskellNone
LanguageHaskell2010

Crypto.Hash.Tsuraan.Blake2.Serial

Synopsis

Documentation

data Ctx Source

Opaque type that tracks the Blake2 hashing state. The update and finalize functions mutate this context.

Instances

init Source

Arguments

:: Int

Desired digest size

-> IO Ctx 

Create a hashing context.

init_key Source

Arguments

:: ByteString

Desired hashing key

-> Int

Desired digest size

-> IO Ctx 

Create a hashing context for key-based hashing.

update Source

Arguments

:: Ctx

Hashing context

-> ByteString

Data to add to the hash

-> IO () 

Add more data to the hash.

finalize Source

Arguments

:: Ctx

Hashing context

-> IO ByteString 

Finish hashing. This returns the digest of all the data that's been given to the update function.

hash Source

Arguments

:: Int

The digest size to generate; must be 1-64

-> ByteString

The string to hash

-> ByteString 

Hash a ByteString into a digest ByteString. This function always runs in serial, which is faster for very small strings but slower as the strings get larger.

hash_key Source

Arguments

:: ByteString

The key to hash with

-> Int

The digest size to generate; must be 1-64

-> ByteString

The string to hash

-> ByteString 

Hash a ByteString into a digest ByteString using a key. This function always runs in serial, which is faster for very small strings but slower as the strings get larger.