| Safe Haskell | None |
|---|
Network.CommSec
Description
CommSec, for communications security.
- data OutContext = Out {}
- data InContext = In {}
- newInContext :: ByteString -> InContext
- newOutContext :: ByteString -> OutContext
- recv :: InContext -> ByteString -> Either String (ByteString, InContext)
- send :: OutContext -> ByteString -> (ByteString, OutContext)
Types
data OutContext Source
A context useful for sending data.
A context useful for receiving data.
Build contexts for use sending and receiving
newInContext :: ByteString -> InContextSource
Given at least 24 bytes of entropy, produce an in context that can communicate with an identically initialized out context.
newOutContext :: ByteString -> OutContextSource
Given at least 24 bytes of entropy, produce an out context that can communicate with an identically initialized in context.
recv :: InContext -> ByteString -> Either String (ByteString, InContext)Source
Use an InContext to decrypt a message, verifying the ICV and sequence
number.
Message format: [ctr, ct, padding, tag].
send :: OutContext -> ByteString -> (ByteString, OutContext)Source
Use an OutContext to protect a message for transport.
Message format: [ctr, ct, padding, tag].