aboutsummaryrefslogtreecommitdiff
path: root/src/Encryption.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Encryption.cpp')
-rw-r--r--src/Encryption.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Encryption.cpp b/src/Encryption.cpp
index ff37270..d4763b8 100644
--- a/src/Encryption.cpp
+++ b/src/Encryption.cpp
@@ -7,7 +7,7 @@ namespace odhtdb
{
static_assert(ENCRYPTION_CHECKSUM_BYTE_SIZE == crypto_aead_xchacha20poly1305_ietf_ABYTES, "Encryption checksum key size has changed for some reason, oops...");
- Encryption::Encryption(const DataView &data, const DataView &additionalData, const DataView &_key)
+ Encryption::Encryption(const DataView &data, const DataView &_key)
{
cipherTextLength = crypto_aead_xchacha20poly1305_ietf_ABYTES + data.size;
cipherText = new unsigned char[cipherTextLength];
@@ -22,7 +22,7 @@ namespace odhtdb
generateKey(key);
randombytes_buf(nonce, ENCRYPTION_NONCE_BYTE_SIZE);
- if(crypto_aead_xchacha20poly1305_ietf_encrypt(cipherText, &cipherTextLength, (const unsigned char*)data.data, data.size, (const unsigned char*)additionalData.data, additionalData.size, nullptr, nonce, key) < 0)
+ if(crypto_aead_xchacha20poly1305_ietf_encrypt(cipherText, &cipherTextLength, (const unsigned char*)data.data, data.size, nullptr, 0, nullptr, nonce, key) < 0)
throw EncryptionException("Failed to encrypt data");
}