| Maintainer | John Galt <jgalt@centromere.net> |
|---|---|
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Crypto.Noise.Hash
Contents
Description
Synopsis
- class Hash h where
- data ChainingKey h :: *
- data Digest h :: *
- hashName :: proxy h -> ScrubbedBytes
- hashLength :: proxy h -> Int
- hash :: ScrubbedBytes -> Digest h
- hashHKDF :: ChainingKey h -> ScrubbedBytes -> Word8 -> [ScrubbedBytes]
- hashBytesToCK :: ScrubbedBytes -> ChainingKey h
- hashCKToBytes :: ChainingKey h -> ScrubbedBytes
- hashToBytes :: Digest h -> ScrubbedBytes
Classes
Typeclass for hashes.
Associated Types
data ChainingKey h :: * #
Represents a chaining key used as part of HKDF.
Represents a hash digest.
Methods
hashName :: proxy h -> ScrubbedBytes #
Returns the name of the hash. This is used when generating the handshake name.
hashLength :: proxy h -> Int #
Returns the length of the hash output in bytes.
hash :: ScrubbedBytes -> Digest h #
Hashes data.
hashHKDF :: ChainingKey h -> ScrubbedBytes -> Word8 -> [ScrubbedBytes] #
Performs HKDF.
hashBytesToCK :: ScrubbedBytes -> ChainingKey h #
Converts a series of bytes to a chaining key.
hashCKToBytes :: ChainingKey h -> ScrubbedBytes #
Converts a chaining key to a series of bytes.
hashToBytes :: Digest h -> ScrubbedBytes #
Converts a hash digest to a series of bytes.