forked from Green-Sky/tomato
Merge commit '565efa4f39650d09c05f3895f9a2b16d0f5e7bad'
This commit is contained in:
@@ -242,7 +242,7 @@ bool tox_pass_key_encrypt(const Tox_Pass_Key *key, const uint8_t plaintext[], si
|
||||
ciphertext += crypto_box_NONCEBYTES;
|
||||
|
||||
/* now encrypt */
|
||||
const int32_t encrypted_len = encrypt_data_symmetric(mem, key->key, nonce, plaintext, plaintext_len, ciphertext);
|
||||
const int32_t encrypted_len = encrypt_data_symmetric((const Memory * _Nonnull)mem, key->key, nonce, plaintext, plaintext_len, ciphertext);
|
||||
if (encrypted_len < 0 || (size_t)encrypted_len != plaintext_len + crypto_box_MACBYTES) {
|
||||
SET_ERROR_PARAMETER(error, TOX_ERR_ENCRYPTION_FAILED);
|
||||
return false;
|
||||
@@ -334,7 +334,7 @@ bool tox_pass_key_decrypt(const Tox_Pass_Key *key, const uint8_t ciphertext[], s
|
||||
ciphertext += crypto_box_NONCEBYTES;
|
||||
|
||||
/* decrypt the ciphertext */
|
||||
const int32_t decrypted_len = decrypt_data_symmetric(mem, key->key, nonce, ciphertext, decrypt_length + crypto_box_MACBYTES, plaintext);
|
||||
const int32_t decrypted_len = decrypt_data_symmetric((const Memory * _Nonnull)mem, key->key, nonce, ciphertext, decrypt_length + crypto_box_MACBYTES, plaintext);
|
||||
if (decrypted_len < 0 || (size_t)decrypted_len != decrypt_length) {
|
||||
SET_ERROR_PARAMETER(error, TOX_ERR_DECRYPTION_FAILED);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user