hashes-0.2.1.0: Hash functions
CopyrightCopyright © 2021 Lars Kuhtz <lakuhtz@gmail.com>
LicenseMIT
MaintainerLars Kuhtz <lakuhtz@gmail.com>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Data.Hash.Internal.OpenSSL

Description

Bindings for OpenSSL EVP Message Digest Routines

Synopsis

EVP digest routines

newtype Algorithm Source #

Constructors

Algorithm (Ptr Void) 

newtype Ctx a Source #

Constructors

Ctx (ForeignPtr Void) 

newtype Digest a Source #

Constructors

Digest ShortByteString 

Instances

Instances details
Eq (Digest a) Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Methods

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

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

Ord (Digest a) Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Methods

compare :: Digest a -> Digest a -> Ordering #

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

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

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

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

max :: Digest a -> Digest a -> Digest a #

min :: Digest a -> Digest a -> Digest a #

Show (Digest a) Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Methods

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

show :: Digest a -> String #

showList :: [Digest a] -> ShowS #

OpenSslDigest a => IncrementalHash (Digest a) Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Associated Types

type Context (Digest a) Source #

Methods

update :: Context (Digest a) -> Ptr Word8 -> Int -> IO () Source #

finalize :: Context (Digest a) -> IO (Digest a) Source #

OpenSslDigest a => Hash (Digest a) Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

type Context (Digest a) Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

type Context (Digest a) = Ctx a

updateCtx :: Ctx a -> Ptr Word8 -> Int -> IO () Source #

Algorithms

class OpenSslDigest a where Source #

Instances

Instances details
OpenSslDigest Blake2s256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

OpenSslDigest Blake2b512 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

OpenSslDigest Shake256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

OpenSslDigest Shake128 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

OpenSslDigest Sha3_512 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

OpenSslDigest Sha3_384 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

OpenSslDigest Sha3_256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

OpenSslDigest Sha3_224 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

OpenSslDigest Sha2_512_256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

OpenSslDigest Sha2_512_224 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

OpenSslDigest Sha2_512 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

OpenSslDigest Sha2_384 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

OpenSslDigest Sha2_256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

OpenSslDigest Sha2_224 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

SHA2

SHA-2 (Secure Hash Algorithm 2) is a family of cryptographic hash functions standardized in NIST FIPS 180-4, first published in 2001. These functions conform to NIST FIPS 180-4.

The following hash functions from the SHA-2 family are supported in openssl-3.0 (cf. https://www.openssl.org/docs/man3.0/man3/EVP_sha224.html)

EVP_sha224, EVP_sha256, EVP_sha512_224, EVP_sha512_256, EVP_sha384, EVP_sha512

newtype Sha2_512_224 Source #

Instances

Instances details
Eq Sha2_512_224 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Ord Sha2_512_224 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Show Sha2_512_224 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

IncrementalHash Sha2_512_224 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Associated Types

type Context Sha2_512_224 Source #

Hash Sha2_512_224 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

OpenSslDigest Sha2_512_224 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

type Context Sha2_512_224 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

newtype Sha2_512_256 Source #

Instances

Instances details
Eq Sha2_512_256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Ord Sha2_512_256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Show Sha2_512_256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

IncrementalHash Sha2_512_256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Associated Types

type Context Sha2_512_256 Source #

Hash Sha2_512_256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

OpenSslDigest Sha2_512_256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

type Context Sha2_512_256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

SHA3

SHA-3 (Secure Hash Algorithm 3) is a family of cryptographic hash functions standardized in NIST FIPS 202, first published in 2015. It is based on the Keccak algorithm. These functions conform to NIST FIPS 202.

The following hash functions from the SHA-3 family are supported in openssl-3.0 (cf. https://www.openssl.org/docs/man3.0/man3/EVP_sha3_224.html)

EVP_sha3_224, EVP_sha3_256, EVP_sha3_384, EVP_sha3_512, EVP_shake128, EVP_shake256

Keccak

This is the latest version of Keccak-256 hash function that was submitted to the SHA3 competition. It is different from the final NIST SHA3 hash.

The difference between NIST SHA3-256 and Keccak-256 is the use of a different padding character for the input message. The former uses '0x06' and the latter uses '0x01'.

This version of Keccak-256 is used by the Ethereum project.

This implementation of Keccak-256 uses internal OpenSSL APIs. It may break with new versions of OpenSSL. It may also be broken for existing versions of OpenSSL. Portability of the code is unknown.

ONLY USE THIS CODE AFTER YOU HAVE VERIFIED THAT IT WORKS WITH OUR VERSION OF OPENSSL.

For details see the file cbits/keccak.c.

Blake2

BLAKE2 is an improved version of BLAKE, which was submitted to the NIST SHA-3 algorithm competition. The BLAKE2s and BLAKE2b algorithms are described in RFC 7693.

The following hash functions from the BLAKE2 family are supported in openssl-3.0 (cf. https://www.openssl.org/docs/man3.0/man3/EVP_blake2b512.html)

EVP_blake2b512, EVP_blake2s256

While the BLAKE2b and BLAKE2s algorithms supports a variable length digest, this implementation outputs a digest of a fixed length (the maximum length supported), which is 512-bits for BLAKE2b and 256-bits for BLAKE2s.

newtype Blake2b512 Source #

newtype Blake2s256 Source #