cacophony-0.10.1: A library implementing the Noise protocol.

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

Crypto.Noise.Internal.NoiseState

Description

 
Synopsis

Documentation

data NoiseState c d h Source #

This type represents the state of an entire Noise conversation, and it is used both during the handshake and for every message read and written thereafter (transport messages). It is parameterized by the Cipher, DH method, and Hash to be used.

nsHandshakeSuspension :: forall c d h. Lens' (NoiseState c d h) (Maybe (ScrubbedBytes -> Handshake c d h ())) Source #

nsHandshakeState :: forall c d h. Lens' (NoiseState c d h) (HandshakeState c d h) Source #

noiseState :: (Cipher c, DH d, Hash h) => HandshakeOpts d -> HandshakePattern -> NoiseState c d h Source #

Creates a NoiseState from the given handshake options and pattern.

resumeHandshake :: (MonadThrow m, Cipher c, DH d, Hash h) => ScrubbedBytes -> NoiseState c d h -> m (HandshakeResult, NoiseState c d h) Source #

Resumes a handshake in progress using the given input data.