hashes-0.3.0.1: Hash functions
CopyrightCopyright © 2021-2024 Lars Kuhtz <lakuhtz@gmail.com>
LicenseMIT
MaintainerLars Kuhtz <lakuhtz@gmail.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Hash.Keccak

Description

| The code in this module 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.

Synopsis

Keccak-256

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.

newtype Keccak256 Source #

Instances

Instances details
IsString Keccak256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Show Keccak256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Eq Keccak256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Ord Keccak256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Hash Keccak256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

IncrementalHash Keccak256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Associated Types

type Context Keccak256 Source #

ResetableHash Keccak256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Methods

reset :: Context Keccak256 -> IO () Source #

OpenSslDigest Keccak256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

type Context Keccak256 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

newtype Keccak512 Source #

Instances

Instances details
IsString Keccak512 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Show Keccak512 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Eq Keccak512 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Ord Keccak512 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Hash Keccak512 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

IncrementalHash Keccak512 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Associated Types

type Context Keccak512 Source #

ResetableHash Keccak512 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Methods

reset :: Context Keccak512 -> IO () Source #

OpenSslDigest Keccak512 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

type Context Keccak512 Source # 
Instance details

Defined in Data.Hash.Internal.OpenSSL

Unsafe finalize functions

finalizeKeccak256Ptr :: Ctx Keccak256 -> Ptr Word8 -> IO () Source #

Low-Level function that writes the final digest directly into the provided pointer. The pointer must point to at least 64 bytes of allocated memory. This is not checked and a violation of this condition may result in a segmentation fault.

finalizeKeccak512Ptr :: Ctx Keccak512 -> Ptr Word8 -> IO () Source #

Low-Level function that writes the final digest directly into the provided pointer. The pointer must point to at least 64 bytes of allocated memory. This is not checked and a violation of this condition may result in a segmentation fault.