Fixed circular dependency between DHT and net_crypto: DHT no longer
depends on net_crypto.
Moved the crypto request packets functions to crypto core and DHT.
Cleaned up/added some defines that can be used to get the true maximum
length of things like the friends request message.
MAX_DATA_SIZE has been replaced in most places by more appropriate defines.
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.
Removed a bunch of useless space from various structs.
pack_nodes() and unpack_nodes() are now used to transmit lists of
nodes for the DHT and onion parts. They provide a way to transmit
both ipv6 and ipv4 nodes in the same packet in a portable way that
takes as little space as possible without compression.
Using pack_nodes, merged the send nodes and send nodes ipv6 packets
into one packet greatly reducing the risk of amplification attacks.
Shared keys for recieved DHT packets are now stored in a special array
so that they don't need to be recomputed for nodes that send us lots of
packets.
DHT.c:
- get_close_nodes():
- allow two 'indirect' nodes ('indirect' as in distant from us and therefore not tested regularly, "bad")
- be consequent when testing for NULLed results, pack nodes_list dense
- (logging) dump number of found entries from assoc
- returnedip_ports():
- fix code cleanup, the entry to be added is about the node we were told, not about the node who told us
assoc.c:
- Assoc_get_close_entries(): break from loops as soon as a marking-invalid-node is hit