Copyright | Copyright © 2021 Lars Kuhtz <lakuhtz@gmail.com> |
---|---|
License | MIT |
Maintainer | Lars Kuhtz <lakuhtz@gmail.com> |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
| 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
- newtype Keccak256 = Keccak256 ShortByteString
- newtype Keccak512 = Keccak512 ShortByteString
- module Data.Hash.Class.Mutable
- finalizeKeccak256Ptr :: Ctx Keccak256 -> Ptr Word8 -> IO ()
- finalizeKeccak512Ptr :: Ctx Keccak512 -> Ptr Word8 -> IO ()
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.
Instances
Show Keccak256 Source # | |
Eq Keccak256 Source # | |
Ord Keccak256 Source # | |
Defined in Data.Hash.Internal.OpenSSL | |
Hash Keccak256 Source # | |
Defined in Data.Hash.Internal.OpenSSL | |
IncrementalHash Keccak256 Source # | |
ResetableHash Keccak256 Source # | |
type Context Keccak256 Source # | |
Defined in Data.Hash.Internal.OpenSSL |
Instances
Show Keccak512 Source # | |
Eq Keccak512 Source # | |
Ord Keccak512 Source # | |
Defined in Data.Hash.Internal.OpenSSL | |
Hash Keccak512 Source # | |
Defined in Data.Hash.Internal.OpenSSL | |
IncrementalHash Keccak512 Source # | |
ResetableHash Keccak512 Source # | |
type Context Keccak512 Source # | |
Defined in Data.Hash.Internal.OpenSSL |
module Data.Hash.Class.Mutable
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.