Crypto-4.2.5.1: Collects together existing Haskell cryptographic functions into a package
Copyright(c) Russell O'Connor 2006
LicenseBSD-style (see the file ReadMe.tex)
Safe HaskellSafe-Inferred
LanguageHaskell98

Data.Digest.SHA2

Description

Implements SHA-256, SHA-384, SHA-512, and SHA-224 as defined in FIPS 180-2 http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf.

Synopsis

Documentation

sha256 :: (Bits a, Integral a) => [a] -> Hash256 #

sha256 currently requires that the bitSize of a divide 32

sha256Ascii :: String -> Hash256 #

shaXXXAscii assumes that all characters of the strings are ISO-latin-1 characters. ie. each characters fits in one octet.

type Hash256 = Hash8 Word32 #

sha512 :: (Bits a, Integral a) => [a] -> Hash512 #

sha384 currently requires that the bitSize of a divide 64

sha512Ascii :: String -> Hash512 #

type Hash512 = Hash8 Word64 #

sha384 :: (Bits a, Integral a) => [a] -> Hash384 #

sha384 currently requires that the bitSize of a divide 64

sha384Ascii :: String -> Hash384 #

data Hash384 #

Instances

Instances details
Eq Hash384 # 
Instance details

Defined in Data.Digest.SHA2

Methods

(==) :: Hash384 -> Hash384 -> Bool

(/=) :: Hash384 -> Hash384 -> Bool

Ord Hash384 # 
Instance details

Defined in Data.Digest.SHA2

Methods

compare :: Hash384 -> Hash384 -> Ordering

(<) :: Hash384 -> Hash384 -> Bool

(<=) :: Hash384 -> Hash384 -> Bool

(>) :: Hash384 -> Hash384 -> Bool

(>=) :: Hash384 -> Hash384 -> Bool

max :: Hash384 -> Hash384 -> Hash384

min :: Hash384 -> Hash384 -> Hash384

Show Hash384 # 
Instance details

Defined in Data.Digest.SHA2

Methods

showsPrec :: Int -> Hash384 -> ShowS

show :: Hash384 -> String

showList :: [Hash384] -> ShowS

sha224 :: (Bits a, Integral a) => [a] -> Hash224 #

sha224 currently requires that the bitSize of a divide 32

sha224Ascii :: String -> Hash224 #

data Hash224 #

Instances

Instances details
Eq Hash224 # 
Instance details

Defined in Data.Digest.SHA2

Methods

(==) :: Hash224 -> Hash224 -> Bool

(/=) :: Hash224 -> Hash224 -> Bool

Ord Hash224 # 
Instance details

Defined in Data.Digest.SHA2

Methods

compare :: Hash224 -> Hash224 -> Ordering

(<) :: Hash224 -> Hash224 -> Bool

(<=) :: Hash224 -> Hash224 -> Bool

(>) :: Hash224 -> Hash224 -> Bool

(>=) :: Hash224 -> Hash224 -> Bool

max :: Hash224 -> Hash224 -> Hash224

min :: Hash224 -> Hash224 -> Hash224

Show Hash224 # 
Instance details

Defined in Data.Digest.SHA2

Methods

showsPrec :: Int -> Hash224 -> ShowS

show :: Hash224 -> String

showList :: [Hash224] -> ShowS

toOctets :: Hash h => h -> [Word8] #