summaryrefslogtreecommitdiff
path: root/toxcore/onion.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-01-01 22:24:09 -0500
committerirungentoo <irungentoo@gmail.com>2014-01-01 22:24:09 -0500
commitec429b7fee273a8d0e5dec952ae998a59c9f1514 (patch)
tree048f9454f1a4dabf13b7d2700eecfe46c999dbad /toxcore/onion.c
parent97b9a9cf04570fde8646d0606fab93344a72153a (diff)
Some small cleanups.
TODO: remove old todos that have been done.
Diffstat (limited to 'toxcore/onion.c')
-rw-r--r--toxcore/onion.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/toxcore/onion.c b/toxcore/onion.c
index bbcae79d..b7a19716 100644
--- a/toxcore/onion.c
+++ b/toxcore/onion.c
@@ -27,14 +27,14 @@
27 27
28#define MAX_ONION_SIZE MAX_DATA_SIZE 28#define MAX_ONION_SIZE MAX_DATA_SIZE
29 29
30#define RETURN_1 (crypto_secretbox_NONCEBYTES + sizeof(IP_Port) + crypto_secretbox_MACBYTES) 30#define RETURN_1 ONION_RETURN_1
31#define RETURN_2 (crypto_secretbox_NONCEBYTES + sizeof(IP_Port) + crypto_secretbox_MACBYTES + RETURN_1) 31#define RETURN_2 ONION_RETURN_2
32#define RETURN_3 (crypto_secretbox_NONCEBYTES + sizeof(IP_Port) + crypto_secretbox_MACBYTES + RETURN_2) 32#define RETURN_3 ONION_RETURN_3
33 33
34#define SEND_BASE (crypto_box_PUBLICKEYBYTES + sizeof(IP_Port) + crypto_box_MACBYTES) 34#define SEND_BASE ONION_SEND_BASE
35#define SEND_3 (crypto_box_NONCEBYTES + SEND_BASE + RETURN_2) 35#define SEND_3 ONION_SEND_3
36#define SEND_2 (crypto_box_NONCEBYTES + SEND_BASE*2 + RETURN_1) 36#define SEND_2 ONION_SEND_2
37#define SEND_1 (crypto_box_NONCEBYTES + SEND_BASE*3) 37#define SEND_1 ONION_SEND_1
38 38
39/* Create and send a onion packet. 39/* Create and send a onion packet.
40 * 40 *
@@ -318,6 +318,7 @@ static int handle_recv_1(void *object, IP_Port source, uint8_t *packet, uint32_t
318} 318}
319 319
320 320
321
321Onion *new_onion(DHT *dht) 322Onion *new_onion(DHT *dht)
322{ 323{
323 if (dht == NULL) 324 if (dht == NULL)