summaryrefslogtreecommitdiff
path: root/ToxCrypto.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-08-31 15:42:27 -0400
committerjoe <joe@jerkface.net>2017-08-31 15:42:49 -0400
commiteba3cdcc646211cc152c16d0813cc7e9b1c3111b (patch)
treee90c45a86d11b16da4eee5f21bb8ee618d7d94d6 /ToxCrypto.hs
parenta6b55a29ff656f105ca79c7d4f060920a37c7c70 (diff)
Separated module OnionTransport from ToxTransport.
Diffstat (limited to 'ToxCrypto.hs')
-rw-r--r--ToxCrypto.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/ToxCrypto.hs b/ToxCrypto.hs
index 6f0fcf1a..4a8de635 100644
--- a/ToxCrypto.hs
+++ b/ToxCrypto.hs
@@ -6,6 +6,8 @@ module ToxCrypto
6 ( PublicKey 6 ( PublicKey
7 , publicKey 7 , publicKey
8 , SecretKey 8 , SecretKey
9 , SymmetricKey(..)
10 , TransportCrypto(..)
9 , Encrypted 11 , Encrypted
10 , Encrypted8 12 , Encrypted8
11 , Assym(..) 13 , Assym(..)
@@ -44,6 +46,7 @@ import Foreign.Ptr
44import Foreign.Storable 46import Foreign.Storable
45import System.Endian 47import System.Endian
46import qualified Data.ByteString.Internal 48import qualified Data.ByteString.Internal
49import Control.Concurrent.STM
47 50
48-- | A 16-byte mac and an arbitrary-length encrypted stream. 51-- | A 16-byte mac and an arbitrary-length encrypted stream.
49newtype Encrypted a = Encrypted ByteString 52newtype Encrypted a = Encrypted ByteString
@@ -226,3 +229,11 @@ data Assym a = Assym
226 , assymData :: a 229 , assymData :: a
227 } 230 }
228 231
232newtype SymmetricKey = SymmetricKey ByteString
233
234data TransportCrypto = TransportCrypto
235 { transportSecret :: SecretKey
236 , transportPublic :: PublicKey
237 , transportSymmetric :: STM SymmetricKey
238 }
239