diff options
author | irungentoo <irungentoo@gmail.com> | 2014-04-21 16:51:36 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-04-21 16:51:36 -0400 |
commit | 9c6a8432ce7298766669d1e6a966b5493971afb7 (patch) | |
tree | 8fd98c412610cbcf3fa8b7c28e0a5efbe02bad77 /toxcore/onion.h | |
parent | 1603ca974eae3fe0d94b597103f04acfb96fcab0 (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.h')
-rw-r--r-- | toxcore/onion.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/toxcore/onion.h b/toxcore/onion.h index 4e363724..b15caad9 100644 --- a/toxcore/onion.h +++ b/toxcore/onion.h | |||
@@ -28,7 +28,7 @@ | |||
28 | typedef struct { | 28 | typedef struct { |
29 | DHT *dht; | 29 | DHT *dht; |
30 | Networking_Core *net; | 30 | Networking_Core *net; |
31 | uint8_t secret_symmetric_key[crypto_secretbox_KEYBYTES]; | 31 | uint8_t secret_symmetric_key[crypto_box_KEYBYTES]; |
32 | uint64_t timestamp; | 32 | uint64_t timestamp; |
33 | 33 | ||
34 | Shared_Keys shared_keys_1; | 34 | Shared_Keys shared_keys_1; |
@@ -39,9 +39,9 @@ typedef struct { | |||
39 | void *callback_object; | 39 | void *callback_object; |
40 | } Onion; | 40 | } Onion; |
41 | 41 | ||
42 | #define ONION_RETURN_1 (crypto_secretbox_NONCEBYTES + sizeof(IP_Port) + crypto_secretbox_MACBYTES) | 42 | #define ONION_RETURN_1 (crypto_box_NONCEBYTES + sizeof(IP_Port) + crypto_box_MACBYTES) |
43 | #define ONION_RETURN_2 (crypto_secretbox_NONCEBYTES + sizeof(IP_Port) + crypto_secretbox_MACBYTES + ONION_RETURN_1) | 43 | #define ONION_RETURN_2 (crypto_box_NONCEBYTES + sizeof(IP_Port) + crypto_box_MACBYTES + ONION_RETURN_1) |
44 | #define ONION_RETURN_3 (crypto_secretbox_NONCEBYTES + sizeof(IP_Port) + crypto_secretbox_MACBYTES + ONION_RETURN_2) | 44 | #define ONION_RETURN_3 (crypto_box_NONCEBYTES + sizeof(IP_Port) + crypto_box_MACBYTES + ONION_RETURN_2) |
45 | 45 | ||
46 | #define ONION_SEND_BASE (crypto_box_PUBLICKEYBYTES + sizeof(IP_Port) + crypto_box_MACBYTES) | 46 | #define ONION_SEND_BASE (crypto_box_PUBLICKEYBYTES + sizeof(IP_Port) + crypto_box_MACBYTES) |
47 | #define ONION_SEND_3 (crypto_box_NONCEBYTES + ONION_SEND_BASE + ONION_RETURN_2) | 47 | #define ONION_SEND_3 (crypto_box_NONCEBYTES + ONION_SEND_BASE + ONION_RETURN_2) |