aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar buttercat1791 <mjjurkoic@gmail.com>2024-06-15 19:09:23 -0500
committerLibravatar buttercat1791 <mjjurkoic@gmail.com>2024-06-15 19:09:23 -0500
commitcd8a645848eac110efb71d460c6c937c92019365 (patch)
treee7d62934d5fd624c09c344eb2218385d36943388
parent5dd823a942afb9461426d2cbba9952526a22a755 (diff)
Stack allocate encryption context
-rw-r--r--src/signer/noscrypt_signer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/signer/noscrypt_signer.cpp b/src/signer/noscrypt_signer.cpp
index 00e8b5e..b4a32cb 100644
--- a/src/signer/noscrypt_signer.cpp
+++ b/src/signer/noscrypt_signer.cpp
@@ -1,5 +1,6 @@
#include <algorithm>
#include <chrono>
+#include <memory>
#include <random>
#include <sstream>
#include <tuple>
@@ -487,7 +488,7 @@ string NoscryptSigner::_encryptNip44(const string input)
}
// Setup the encryption context.
- unique_ptr<NCEncryptionArgs> encryptionArgs(new NCEncryptionArgs
+ auto encryptionArgs = make_unique<NCEncryptionArgs>(NCEncryptionArgs
{
nonce.get(),
hmacKey.get(),
@@ -532,7 +533,7 @@ string NoscryptSigner::_decryptNip44(const string input)
}
// Set up the decryption context.
- unique_ptr<NCEncryptionArgs> decryptionArgs(new NCEncryptionArgs
+ auto decryptionArgs = make_unique<NCEncryptionArgs>(NCEncryptionArgs
{
nonce.get(),
hmacKey.get(),