cacophony-0.4.0: A library implementing the Noise protocol.

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

Crypto.Noise.Types

Contents

Description

 

Synopsis

Types

data ScrubbedBytes :: *

ScrubbedBytes is a memory chunk which have the properties of:

  • Being scrubbed after its goes out of scope.
  • A Show instance that doesn't actually show any content
  • A Eq instance that is constant time

data NoiseException Source

Represents exceptions which can occur. DecryptionFailure is thrown if a symmetric decryption operation fails, which is usually the result of an invalid authentication tag. HandshakeStateFailure is thrown if the HandshakeState is improperly initialized for the given handshake type.

If your goal is to detect an invalid PSK, prologue, etc, you'll want to catch DecryptionFailure.

Functions

convert :: (ByteArrayAccess bin, ByteArray bout) => bin -> bout

Convert a bytearray to another type of bytearray

append :: ByteArray bs => bs -> bs -> bs

append one bytearray to the other

bsToSB :: ByteString -> ScrubbedBytes Source

Converts a lazy ByteString to ScrubbedBytes.

bsToSB' :: ByteString -> ScrubbedBytes Source

Strict version of bsToSB.

sbToBS :: ScrubbedBytes -> ByteString Source

Converts ScrubbedBytes to a lazy ByteString.

sbEq :: ScrubbedBytes -> ScrubbedBytes -> Bool Source

Equality operator for ScrubbedBytes.