diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-11-06 15:14:02 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-11-09 22:30:49 +0000 |
commit | aed24408db9cd8afe632a1d3f056669ae34f49be (patch) | |
tree | 77cb037490b3f97af949eb39dfdf2e1e513b61d1 /toxcore/ping.c | |
parent | 42dfdf73c1dfd899a4f5a44ea1584aaf3a4ed3d2 (diff) |
Remove new_nonce function in favour of random_nonce.
`new_nonce` has been an alias for `random_nonce` for a while now. Having
two names for the same operation is confusing. `random_nonce` better
expresses the intent. The documentation for `new_nonce` talks about
guaranteeing that the nonce is different from previous ones, which is
incorrect, it's just quite likely to be different.
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 052650e3..bde28b59 100644 --- a/toxcore/ping.c +++ b/toxcore/ping.c | |||
@@ -88,7 +88,7 @@ int send_ping_request(PING *ping, IP_Port ipp, const uint8_t *public_key) | |||
88 | 88 | ||
89 | pk[0] = NET_PACKET_PING_REQUEST; | 89 | pk[0] = NET_PACKET_PING_REQUEST; |
90 | id_copy(pk + 1, ping->dht->self_public_key); // Our pubkey | 90 | id_copy(pk + 1, ping->dht->self_public_key); // Our pubkey |
91 | new_nonce(pk + 1 + crypto_box_PUBLICKEYBYTES); // Generate new nonce | 91 | random_nonce(pk + 1 + crypto_box_PUBLICKEYBYTES); // Generate new nonce |
92 | 92 | ||
93 | 93 | ||
94 | rc = encrypt_data_symmetric(shared_key, | 94 | rc = encrypt_data_symmetric(shared_key, |
@@ -119,7 +119,7 @@ static int send_ping_response(PING *ping, IP_Port ipp, const uint8_t *public_key | |||
119 | 119 | ||
120 | pk[0] = NET_PACKET_PING_RESPONSE; | 120 | pk[0] = NET_PACKET_PING_RESPONSE; |
121 | id_copy(pk + 1, ping->dht->self_public_key); // Our pubkey | 121 | id_copy(pk + 1, ping->dht->self_public_key); // Our pubkey |
122 | new_nonce(pk + 1 + crypto_box_PUBLICKEYBYTES); // Generate new nonce | 122 | random_nonce(pk + 1 + crypto_box_PUBLICKEYBYTES); // Generate new nonce |
123 | 123 | ||
124 | // Encrypt ping_id using recipient privkey | 124 | // Encrypt ping_id using recipient privkey |
125 | rc = encrypt_data_symmetric(shared_encryption_key, | 125 | rc = encrypt_data_symmetric(shared_encryption_key, |