Maintainer | John Galt <jgalt@centromere.net> |
---|---|
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
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.
data ChainingKey h :: * Source #
Represents a chaining key used as part of HKDF.
Represents a hash digest.
hashName :: proxy h -> ScrubbedBytes Source #
Returns the name of the hash. This is used when generating the handshake name.
hashLength :: proxy h -> Int Source #
Returns the length of the hash output in bytes.
hash :: ScrubbedBytes -> Digest h Source #
Hashes data.
hashHKDF :: ChainingKey h -> ScrubbedBytes -> Word8 -> [ScrubbedBytes] Source #
Performs HKDF.
hashBytesToCK :: ScrubbedBytes -> ChainingKey h Source #
Converts a series of bytes to a chaining key.
hashCKToBytes :: ChainingKey h -> ScrubbedBytes Source #
Converts a chaining key to a series of bytes.
hashToBytes :: Digest h -> ScrubbedBytes Source #
Converts a hash digest to a series of bytes.