diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-04-27 04:15:33 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-18 23:25:46 +0200 |
commit | 04cfe9c03baa5691ebfad6e039e4f0acd74fd8e1 (patch) | |
tree | aafcc5450024b1f72dfb8b287b70c4185b890dc6 /src/Encryption.cpp | |
parent | 8841ea78fd3386118c7514c89c22fae057cc151a (diff) |
Add local user storage function (locally stored encrypted user private key)
Diffstat (limited to 'src/Encryption.cpp')
-rw-r--r-- | src/Encryption.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Encryption.cpp b/src/Encryption.cpp index e67c719..1d6bfc0 100644 --- a/src/Encryption.cpp +++ b/src/Encryption.cpp @@ -7,8 +7,8 @@ namespace odhtdb { Encryption::Encryption(const DataView &data, const DataView &additionalData, const DataView &_key) { - cipherText = new unsigned char[crypto_aead_xchacha20poly1305_ietf_ABYTES + data.size]; cipherTextLength = crypto_aead_xchacha20poly1305_ietf_ABYTES + data.size; + cipherText = new unsigned char[cipherTextLength]; if(_key.data) { @@ -46,8 +46,8 @@ namespace odhtdb Decryption::Decryption(const DataView &data, const DataView &nonce, const DataView &key) { - decryptedText = new unsigned char[data.size]; decryptedTextLength = data.size; + decryptedText = new unsigned char[decryptedTextLength]; if(nonce.size < ENCRYPTION_NONCE_BYTE_SIZE) throw DecryptionException("Nonce is not big enough"); |