bitcoin-hs-0.0.1: Partial implementation of the Bitcoin protocol (as of 2013)

Safe HaskellNone
LanguageHaskell98

Bitcoin.Crypto.Hash.HMAC

Description

Hash-based message authentication code (HMAC).

See http://en.wikipedia.org/wiki/Hmac

Synopsis

Documentation

newtype HMAC a Source #

Constructors

HMAC 

Fields

Instances

Eq a => Eq (HMAC a) Source # 

Methods

(==) :: HMAC a -> HMAC a -> Bool #

(/=) :: HMAC a -> HMAC a -> Bool #

Ord a => Ord (HMAC a) Source # 

Methods

compare :: HMAC a -> HMAC a -> Ordering #

(<) :: HMAC a -> HMAC a -> Bool #

(<=) :: HMAC a -> HMAC a -> Bool #

(>) :: HMAC a -> HMAC a -> Bool #

(>=) :: HMAC a -> HMAC a -> Bool #

max :: HMAC a -> HMAC a -> HMAC a #

min :: HMAC a -> HMAC a -> HMAC a #

Show a => Show (HMAC a) Source # 

Methods

showsPrec :: Int -> HMAC a -> ShowS #

show :: HMAC a -> String #

showList :: [HMAC a] -> ShowS #

newtype HMACKey Source #

The HMAC key should be an integer between 1 and 2^512-1 (or 2^1024-1 in case of SHA512)

Constructors

HMACKey 

Fields

hmacKeyFromString64 :: OctetStream a => a -> HMACKey Source #

Mainly for testing. 64 byte blocksize version.

Note: blocksize is 64 bytes (512 bits) for both SHA1 and SHA256 and even MD5, but 128 bytes (1024 bits) for SHA512

Also it seems that according the spec long keys should be hashed. Even though the hash is half as long (but we use zero padding anyway)

hmacKeyFromString128 :: OctetStream a => a -> HMACKey Source #

Mainly for testing. 128 byte blocksize version

Note: blocksize is 64 bytes (512 bits) for both SHA1 and SHA256 and even MD5, but 128 bytes (1024 bits) for SHA512

Also it seems that according the spec long keys should be hashed. Even though the hash is half as long (but we use zero padding anyway)