Maintainer | John Galt <jgalt@centromere.net> |
---|---|
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data NoiseState c d h = NoiseState {
- _nsHandshakeState :: HandshakeState c d h
- _nsHandshakePattern :: HandshakePattern
- _nsHandshakeSuspension :: Maybe (ScrubbedBytes -> Handshake c d h ())
- _nsSendingCipherState :: Maybe (CipherState c)
- _nsReceivingCipherState :: Maybe (CipherState c)
- nsSendingCipherState :: forall c d h. Lens' (NoiseState c d h) (Maybe (CipherState c))
- nsReceivingCipherState :: forall c d h. Lens' (NoiseState c d h) (Maybe (CipherState c))
- nsHandshakeSuspension :: forall c d h. Lens' (NoiseState c d h) (Maybe (ScrubbedBytes -> Handshake c d h ()))
- nsHandshakeState :: forall c d h. Lens' (NoiseState c d h) (HandshakeState c d h)
- nsHandshakePattern :: forall c d h. Lens' (NoiseState c d h) HandshakePattern
- noiseState :: (Cipher c, DH d, Hash h) => HandshakeOpts d -> HandshakePattern -> NoiseState c d h
- resumeHandshake :: (MonadThrow m, Cipher c, DH d, Hash h) => ScrubbedBytes -> NoiseState c d h -> m (HandshakeResult, NoiseState c d h)
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.
NoiseState | |
|
nsSendingCipherState :: forall c d h. Lens' (NoiseState c d h) (Maybe (CipherState c)) Source #
nsReceivingCipherState :: forall c d h. Lens' (NoiseState c d h) (Maybe (CipherState c)) Source #
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 #
nsHandshakePattern :: forall c d h. Lens' (NoiseState c d h) HandshakePattern 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.