diff options
author | joe <joe@jerkface.net> | 2017-08-31 15:42:27 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-08-31 15:42:49 -0400 |
commit | eba3cdcc646211cc152c16d0813cc7e9b1c3111b (patch) | |
tree | e90c45a86d11b16da4eee5f21bb8ee618d7d94d6 /ToxCrypto.hs | |
parent | a6b55a29ff656f105ca79c7d4f060920a37c7c70 (diff) |
Separated module OnionTransport from ToxTransport.
Diffstat (limited to 'ToxCrypto.hs')
-rw-r--r-- | ToxCrypto.hs | 11 |
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 | |||
44 | import Foreign.Storable | 46 | import Foreign.Storable |
45 | import System.Endian | 47 | import System.Endian |
46 | import qualified Data.ByteString.Internal | 48 | import qualified Data.ByteString.Internal |
49 | import 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. |
49 | newtype Encrypted a = Encrypted ByteString | 52 | newtype Encrypted a = Encrypted ByteString |
@@ -226,3 +229,11 @@ data Assym a = Assym | |||
226 | , assymData :: a | 229 | , assymData :: a |
227 | } | 230 | } |
228 | 231 | ||
232 | newtype SymmetricKey = SymmetricKey ByteString | ||
233 | |||
234 | data TransportCrypto = TransportCrypto | ||
235 | { transportSecret :: SecretKey | ||
236 | , transportPublic :: PublicKey | ||
237 | , transportSymmetric :: STM SymmetricKey | ||
238 | } | ||
239 | |||