summaryrefslogtreecommitdiff
path: root/ToxData.hs
diff options
context:
space:
mode:
Diffstat (limited to 'ToxData.hs')
-rw-r--r--ToxData.hs23
1 files changed, 23 insertions, 0 deletions
diff --git a/ToxData.hs b/ToxData.hs
new file mode 100644
index 00000000..06a9b3b8
--- /dev/null
+++ b/ToxData.hs
@@ -0,0 +1,23 @@
1module ToxData where
2
3import Crypto
4
5-- data DHTPacketKind = Ping | Pong | GetNodes | SendNodes
6data DHTPacket a = DHTPacket
7 { dhtSender :: PublicKey
8 , dhtEncrypted :: WithNonce24 (Encrypted (WithNonce8 a))
9 }
10
11data WithNonce8 a = WithNonce8 a Nonce8
12
13data WithNonce24 a = WithNonce24 a Nonce24
14
15data AliasedRequest a = AliasedRequest
16 { alias :: PublicKey
17 , aliasPayload :: WithNonce24 (Encrypted (WithNonce8 a))
18 }
19
20data ForwardedRequest a = ForwardedRequest
21 { forwardTo :: PublicKey
22 , forwarded :: AliasedRequest a
23 }