From ce29c8e7ec91d95167b2dea3aee9fd1ae1aac254 Mon Sep 17 00:00:00 2001 From: iphydf Date: Mon, 19 Dec 2016 02:47:42 +0000 Subject: Wrap all sodium/nacl functions in crypto_core.c. --- toxcore/LAN_discovery.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'toxcore/LAN_discovery.c') diff --git a/toxcore/LAN_discovery.c b/toxcore/LAN_discovery.c index 48e0e7bb..6778e932 100644 --- a/toxcore/LAN_discovery.c +++ b/toxcore/LAN_discovery.c @@ -329,7 +329,7 @@ static int handle_LANdiscovery(void *object, IP_Port source, const uint8_t *pack return 1; } - if (length != crypto_box_PUBLICKEYBYTES + 1) { + if (length != CRYPTO_PUBLIC_KEY_SIZE + 1) { return 1; } @@ -340,11 +340,11 @@ static int handle_LANdiscovery(void *object, IP_Port source, const uint8_t *pack int send_LANdiscovery(uint16_t port, DHT *dht) { - uint8_t data[crypto_box_PUBLICKEYBYTES + 1]; + uint8_t data[CRYPTO_PUBLIC_KEY_SIZE + 1]; data[0] = NET_PACKET_LAN_DISCOVERY; id_copy(data + 1, dht->self_public_key); - send_broadcasts(dht->net, port, data, 1 + crypto_box_PUBLICKEYBYTES); + send_broadcasts(dht->net, port, data, 1 + CRYPTO_PUBLIC_KEY_SIZE); int res = -1; IP_Port ip_port; @@ -355,7 +355,7 @@ int send_LANdiscovery(uint16_t port, DHT *dht) ip_port.ip = broadcast_ip(AF_INET6, AF_INET6); if (ip_isset(&ip_port.ip)) { - if (sendpacket(dht->net, ip_port, data, 1 + crypto_box_PUBLICKEYBYTES) > 0) { + if (sendpacket(dht->net, ip_port, data, 1 + CRYPTO_PUBLIC_KEY_SIZE) > 0) { res = 1; } } @@ -365,7 +365,7 @@ int send_LANdiscovery(uint16_t port, DHT *dht) ip_port.ip = broadcast_ip(dht->net->family, AF_INET); if (ip_isset(&ip_port.ip)) { - if (sendpacket(dht->net, ip_port, data, 1 + crypto_box_PUBLICKEYBYTES)) { + if (sendpacket(dht->net, ip_port, data, 1 + CRYPTO_PUBLIC_KEY_SIZE)) { res = 1; } } -- cgit v1.2.3