summaryrefslogtreecommitdiff
path: root/toxcore/TCP_server.h
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2016-12-19 02:47:42 +0000
committeriphydf <iphydf@users.noreply.github.com>2016-12-22 10:26:59 +0000
commitce29c8e7ec91d95167b2dea3aee9fd1ae1aac254 (patch)
treea288df55c44e8edf816e6abbde19a70faef73394 /toxcore/TCP_server.h
parent7122d2e862e028a730478d88cd61557fbed16ebf (diff)
Wrap all sodium/nacl functions in crypto_core.c.
Diffstat (limited to 'toxcore/TCP_server.h')
-rw-r--r--toxcore/TCP_server.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/toxcore/TCP_server.h b/toxcore/TCP_server.h
index 4dcfe126..f2618330 100644
--- a/toxcore/TCP_server.h
+++ b/toxcore/TCP_server.h
@@ -41,9 +41,9 @@
41 41
42#define MAX_PACKET_SIZE 2048 42#define MAX_PACKET_SIZE 2048
43 43
44#define TCP_HANDSHAKE_PLAIN_SIZE (crypto_box_PUBLICKEYBYTES + crypto_box_NONCEBYTES) 44#define TCP_HANDSHAKE_PLAIN_SIZE (CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_NONCE_SIZE)
45#define TCP_SERVER_HANDSHAKE_SIZE (crypto_box_NONCEBYTES + TCP_HANDSHAKE_PLAIN_SIZE + crypto_box_MACBYTES) 45#define TCP_SERVER_HANDSHAKE_SIZE (CRYPTO_NONCE_SIZE + TCP_HANDSHAKE_PLAIN_SIZE + CRYPTO_MAC_SIZE)
46#define TCP_CLIENT_HANDSHAKE_SIZE (crypto_box_PUBLICKEYBYTES + TCP_SERVER_HANDSHAKE_SIZE) 46#define TCP_CLIENT_HANDSHAKE_SIZE (CRYPTO_PUBLIC_KEY_SIZE + TCP_SERVER_HANDSHAKE_SIZE)
47#define TCP_MAX_OOB_DATA_LENGTH 1024 47#define TCP_MAX_OOB_DATA_LENGTH 1024
48 48
49#define NUM_RESERVED_PORTS 16 49#define NUM_RESERVED_PORTS 16
@@ -90,13 +90,13 @@ struct TCP_Priority_List {
90 90
91typedef struct TCP_Secure_Connection { 91typedef struct TCP_Secure_Connection {
92 sock_t sock; 92 sock_t sock;
93 uint8_t public_key[crypto_box_PUBLICKEYBYTES]; 93 uint8_t public_key[CRYPTO_PUBLIC_KEY_SIZE];
94 uint8_t recv_nonce[crypto_box_NONCEBYTES]; /* Nonce of received packets. */ 94 uint8_t recv_nonce[CRYPTO_NONCE_SIZE]; /* Nonce of received packets. */
95 uint8_t sent_nonce[crypto_box_NONCEBYTES]; /* Nonce of sent packets. */ 95 uint8_t sent_nonce[CRYPTO_NONCE_SIZE]; /* Nonce of sent packets. */
96 uint8_t shared_key[crypto_box_BEFORENMBYTES]; 96 uint8_t shared_key[CRYPTO_SHARED_KEY_SIZE];
97 uint16_t next_packet_length; 97 uint16_t next_packet_length;
98 struct { 98 struct {
99 uint8_t public_key[crypto_box_PUBLICKEYBYTES]; 99 uint8_t public_key[CRYPTO_PUBLIC_KEY_SIZE];
100 uint32_t index; 100 uint32_t index;
101 uint8_t status; /* 0 if not used, 1 if other is offline, 2 if other is online. */ 101 uint8_t status; /* 0 if not used, 1 if other is offline, 2 if other is online. */
102 uint8_t other_id; 102 uint8_t other_id;