Safe Haskell | None |
---|---|
Language | Haskell2010 |
Once a peer is found, and both sides have mailboxes open, the peers need to
generate a shared SessionKey
based on their shared password.
pakeExchange
has the logic for doing this.
Synopsis
- pakeExchange :: Connection -> Password -> IO SessionKey
- newtype PakeError = Error (MessageError Text)
- spakeBytesToMessageBody :: ByteString -> Body
- messageBodyToSpakeBytes :: Body -> Either Text ByteString
Documentation
:: Connection | A connection to a peer |
-> Password | The shared password. Construct with |
-> IO SessionKey | A key that can be used for the remainder of the session |
Exchange SPAKE2 keys with a Magic Wormhole peer.
Throws an Error
if we cannot parse the incoming message.
An error that occured during pakeExchange
.
Instances
Eq PakeError Source # | |
Show PakeError Source # | |
Exception PakeError Source # | |
Defined in MagicWormhole.Internal.Pake toException :: PakeError -> SomeException # fromException :: SomeException -> Maybe PakeError # displayException :: PakeError -> String # |
Exported for testing
spakeBytesToMessageBody :: ByteString -> Body Source #
Encode the bytes generated by the SPAKE2 algorithm into a Magic Wormhole message body.
messageBodyToSpakeBytes :: Body -> Either Text ByteString Source #
Decode a Magic Wormhole message body into bytes that can be used as input into the SPAKE2 algorithm.