From eba3cdcc646211cc152c16d0813cc7e9b1c3111b Mon Sep 17 00:00:00 2001 From: joe Date: Thu, 31 Aug 2017 15:42:27 -0400 Subject: Separated module OnionTransport from ToxTransport. --- ToxCrypto.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ToxCrypto.hs') diff --git a/ToxCrypto.hs b/ToxCrypto.hs index 6f0fcf1a..4a8de635 100644 --- a/ToxCrypto.hs +++ b/ToxCrypto.hs @@ -6,6 +6,8 @@ module ToxCrypto ( PublicKey , publicKey , SecretKey + , SymmetricKey(..) + , TransportCrypto(..) , Encrypted , Encrypted8 , Assym(..) @@ -44,6 +46,7 @@ import Foreign.Ptr import Foreign.Storable import System.Endian import qualified Data.ByteString.Internal +import Control.Concurrent.STM -- | A 16-byte mac and an arbitrary-length encrypted stream. newtype Encrypted a = Encrypted ByteString @@ -226,3 +229,11 @@ data Assym a = Assym , assymData :: a } +newtype SymmetricKey = SymmetricKey ByteString + +data TransportCrypto = TransportCrypto + { transportSecret :: SecretKey + , transportPublic :: PublicKey + , transportSymmetric :: STM SymmetricKey + } + -- cgit v1.2.3