cacophony-0.10.1: A library implementing the Noise protocol.

MaintainerJohn Galt <jgalt@centromere.net>
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Crypto.Noise.Hash

Contents

Description

 
Synopsis

Classes

class Hash h where Source #

Typeclass for hashes.

Associated Types

data ChainingKey h :: * Source #

Represents a chaining key used as part of HKDF.

data Digest h :: * Source #

Represents a hash digest.

Methods

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.

Instances
Hash BLAKE2b Source # 
Instance details

Defined in Crypto.Noise.Hash.BLAKE2b

Associated Types

data ChainingKey BLAKE2b :: Type Source #

data Digest BLAKE2b :: Type Source #

Hash BLAKE2s Source # 
Instance details

Defined in Crypto.Noise.Hash.BLAKE2s

Associated Types

data ChainingKey BLAKE2s :: Type Source #

data Digest BLAKE2s :: Type Source #

Hash SHA256 Source # 
Instance details

Defined in Crypto.Noise.Hash.SHA256

Associated Types

data ChainingKey SHA256 :: Type Source #

data Digest SHA256 :: Type Source #

Hash SHA512 Source # 
Instance details

Defined in Crypto.Noise.Hash.SHA512

Associated Types

data ChainingKey SHA512 :: Type Source #

data Digest SHA512 :: Type Source #