cacophony-0.4.0: 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 -> (ChainingKey h, 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.