diff options
author | irungentoo <irungentoo@gmail.com> | 2014-03-05 16:54:17 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-03-05 16:54:17 -0500 |
commit | 3bcc6e2ae547ae77f14d7d140a363cc2cc01f01a (patch) | |
tree | 77d88f12335573afcb61238d74828a4e131222a6 /toxcore/ping.c | |
parent | 3a1f259cb9f939ceeb6d8794873a9bf683c2e730 (diff) |
CPU optimizations.
Use get_shared_key() in more places.
Diffstat (limited to 'toxcore/ping.c')
-rw-r--r-- | toxcore/ping.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/ping.c b/toxcore/ping.c index ff410f39..0aad3f9f 100644 --- a/toxcore/ping.c +++ b/toxcore/ping.c | |||
@@ -156,7 +156,7 @@ int send_ping_request(PING *ping, IP_Port ipp, uint8_t *client_id) | |||
156 | uint8_t shared_key[crypto_box_BEFORENMBYTES]; | 156 | uint8_t shared_key[crypto_box_BEFORENMBYTES]; |
157 | 157 | ||
158 | // generate key to encrypt ping_id with recipient privkey | 158 | // generate key to encrypt ping_id with recipient privkey |
159 | encrypt_precompute(client_id, ping->dht->self_secret_key, shared_key); | 159 | DHT_get_shared_key_sent(ping->dht, shared_key, client_id); |
160 | // Generate random ping_id. | 160 | // Generate random ping_id. |
161 | ping_id = add_ping(ping, ipp, shared_key); | 161 | ping_id = add_ping(ping, ipp, shared_key); |
162 | 162 | ||
@@ -218,7 +218,7 @@ static int handle_ping_request(void *_dht, IP_Port source, uint8_t *packet, uint | |||
218 | uint8_t shared_key[crypto_box_BEFORENMBYTES]; | 218 | uint8_t shared_key[crypto_box_BEFORENMBYTES]; |
219 | 219 | ||
220 | // Decrypt ping_id | 220 | // Decrypt ping_id |
221 | DHT_get_shared_key(dht, shared_key, packet + 1); | 221 | DHT_get_shared_key_recv(dht, shared_key, packet + 1); |
222 | rc = decrypt_data_fast(shared_key, | 222 | rc = decrypt_data_fast(shared_key, |
223 | packet + 1 + CLIENT_ID_SIZE, | 223 | packet + 1 + CLIENT_ID_SIZE, |
224 | packet + 1 + CLIENT_ID_SIZE + crypto_box_NONCEBYTES, | 224 | packet + 1 + CLIENT_ID_SIZE + crypto_box_NONCEBYTES, |