mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed typo.
This typo doesn't seem to cause any issue because according to the code in vanilla NaCl the first crypto_box_ZEROBYTES (for encryption) and crypto_box_BOXZEROBYTES (for decryption) of the array passed to the crypto_box*() functions don't need to be zero for it to work. The documentation however clearly states that they need to be zero which means they need to be zero.
This commit is contained in:
parent
8d8083b38c
commit
0b4640a508
|
@ -105,7 +105,7 @@ int decrypt_data_symmetric(const uint8_t *secret_key, const uint8_t *nonce, cons
|
|||
uint8_t temp_plain[length + crypto_box_ZEROBYTES];
|
||||
uint8_t temp_encrypted[length + crypto_box_BOXZEROBYTES];
|
||||
|
||||
memset(temp_plain, 0, crypto_box_BOXZEROBYTES);
|
||||
memset(temp_encrypted, 0, crypto_box_BOXZEROBYTES);
|
||||
memcpy(temp_encrypted + crypto_box_BOXZEROBYTES, encrypted, length); // Pad the message with 16 0 bytes.
|
||||
|
||||
if (crypto_box_open_afternm(temp_plain, temp_encrypted, length + crypto_box_BOXZEROBYTES, nonce, secret_key) != 0)
|
||||
|
|
Loading…
Reference in New Issue
Block a user