| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
MagicWormhole.Internal.Pake
Contents
Description
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.
- pakeExchange :: Connection -> Password -> IO SessionKey
- newtype PakeError = Error (MessageError Text)
- spakeBytesToMessageBody :: ByteString -> Body
- messageBodyToSpakeBytes :: Body -> Either Text ByteString
Documentation
Arguments
| :: 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.
Constructors
| Error (MessageError Text) |
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.