diff options
Diffstat (limited to 'ToxData.hs')
-rw-r--r-- | ToxData.hs | 23 |
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 @@ | |||
1 | module ToxData where | ||
2 | |||
3 | import Crypto | ||
4 | |||
5 | -- data DHTPacketKind = Ping | Pong | GetNodes | SendNodes | ||
6 | data DHTPacket a = DHTPacket | ||
7 | { dhtSender :: PublicKey | ||
8 | , dhtEncrypted :: WithNonce24 (Encrypted (WithNonce8 a)) | ||
9 | } | ||
10 | |||
11 | data WithNonce8 a = WithNonce8 a Nonce8 | ||
12 | |||
13 | data WithNonce24 a = WithNonce24 a Nonce24 | ||
14 | |||
15 | data AliasedRequest a = AliasedRequest | ||
16 | { alias :: PublicKey | ||
17 | , aliasPayload :: WithNonce24 (Encrypted (WithNonce8 a)) | ||
18 | } | ||
19 | |||
20 | data ForwardedRequest a = ForwardedRequest | ||
21 | { forwardTo :: PublicKey | ||
22 | , forwarded :: AliasedRequest a | ||
23 | } | ||