summaryrefslogtreecommitdiff
path: root/toxcore/onion_announce.h
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-04-21 16:51:36 -0400
committerirungentoo <irungentoo@gmail.com>2014-04-21 16:51:36 -0400
commit9c6a8432ce7298766669d1e6a966b5493971afb7 (patch)
tree8fd98c412610cbcf3fa8b7c28e0a5efbe02bad77 /toxcore/onion_announce.h
parent1603ca974eae3fe0d94b597103f04acfb96fcab0 (diff)
Crypto related cleanups.
Moved Bunch of functions from net_crypto to crypto_core. decrypt_data_fast and decrypt_data_symmetric were the same thing therefore, removed decrypt_data_fast. Replaced all the crypto_secretbox_* defines with the equivalent crypto_box_* one. New define: crypto_box_KEYBYTES that is equal to crypto_box_BEFORENMBYTES.
Diffstat (limited to 'toxcore/onion_announce.h')
-rw-r--r--toxcore/onion_announce.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/onion_announce.h b/toxcore/onion_announce.h
index b7e08363..071dc9ff 100644
--- a/toxcore/onion_announce.h
+++ b/toxcore/onion_announce.h
@@ -29,7 +29,7 @@
29#define ONION_ANNOUNCE_TIMEOUT 300 29#define ONION_ANNOUNCE_TIMEOUT 300
30#define ONION_PING_ID_SIZE crypto_hash_sha256_BYTES 30#define ONION_PING_ID_SIZE crypto_hash_sha256_BYTES
31 31
32#define ONION_ANNOUNCE_SENDBACK_DATA_LENGTH (crypto_secretbox_NONCEBYTES + sizeof(uint32_t) + sizeof(uint64_t) + crypto_box_PUBLICKEYBYTES + sizeof(IP_Port) + crypto_secretbox_MACBYTES) 32#define ONION_ANNOUNCE_SENDBACK_DATA_LENGTH (crypto_box_NONCEBYTES + sizeof(uint32_t) + sizeof(uint64_t) + crypto_box_PUBLICKEYBYTES + sizeof(IP_Port) + crypto_box_MACBYTES)
33 33
34#define ONION_ANNOUNCE_RESPONSE_MIN_SIZE (1 + ONION_ANNOUNCE_SENDBACK_DATA_LENGTH + crypto_box_NONCEBYTES + 1 + ONION_PING_ID_SIZE + crypto_box_MACBYTES) 34#define ONION_ANNOUNCE_RESPONSE_MIN_SIZE (1 + ONION_ANNOUNCE_SENDBACK_DATA_LENGTH + crypto_box_NONCEBYTES + 1 + ONION_PING_ID_SIZE + crypto_box_MACBYTES)
35#define ONION_ANNOUNCE_RESPONSE_MAX_SIZE (ONION_ANNOUNCE_RESPONSE_MIN_SIZE + sizeof(Node_format)*MAX_SENT_NODES) 35#define ONION_ANNOUNCE_RESPONSE_MAX_SIZE (ONION_ANNOUNCE_RESPONSE_MIN_SIZE + sizeof(Node_format)*MAX_SENT_NODES)
@@ -52,8 +52,8 @@ typedef struct {
52 DHT *dht; 52 DHT *dht;
53 Networking_Core *net; 53 Networking_Core *net;
54 Onion_Announce_Entry entries[ONION_ANNOUNCE_MAX_ENTRIES]; 54 Onion_Announce_Entry entries[ONION_ANNOUNCE_MAX_ENTRIES];
55 /* This is crypto_secretbox_KEYBYTES long just so we can use new_symmetric_key() to fill it */ 55 /* This is crypto_box_KEYBYTES long just so we can use new_symmetric_key() to fill it */
56 uint8_t secret_bytes[crypto_secretbox_KEYBYTES]; 56 uint8_t secret_bytes[crypto_box_KEYBYTES];
57 57
58 Shared_Keys shared_keys_recv; 58 Shared_Keys shared_keys_recv;
59} Onion_Announce; 59} Onion_Announce;