aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/nca_patch.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-08-03 14:14:39 -0400
committerLioncash <mathew1800@gmail.com>2020-08-03 14:29:58 -0400
commit15660bd8570735139d91d0165a2614747f570202 (patch)
tree6886854694175d87bf33924c1799b1b46e4fd05d /src/core/file_sys/nca_patch.cpp
parent9b75481755c8d566bc666465d659115bba2b2578 (diff)
aes_util: Allow SetIV to be non-allocating
In a few places, the data to be set as the IV is already within an array. We shouldn't require this data to be heap-allocated if it doesn't need to be. This allows certain callers to reduce heap churn.
Diffstat (limited to 'src/core/file_sys/nca_patch.cpp')
-rw-r--r--src/core/file_sys/nca_patch.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/file_sys/nca_patch.cpp b/src/core/file_sys/nca_patch.cpp
index 0090cc6c4..fe7375e84 100644
--- a/src/core/file_sys/nca_patch.cpp
+++ b/src/core/file_sys/nca_patch.cpp
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include <algorithm>
+#include <array>
#include <cstddef>
#include <cstring>
@@ -66,7 +67,7 @@ std::size_t BKTR::Read(u8* data, std::size_t length, std::size_t offset) const {
Core::Crypto::AESCipher<Core::Crypto::Key128> cipher(key, Core::Crypto::Mode::CTR);
// Calculate AES IV
- std::vector<u8> iv(16);
+ std::array<u8, 16> iv{};
auto subsection_ctr = subsection.ctr;
auto offset_iv = section_offset + base_offset;
for (std::size_t i = 0; i < section_ctr.size(); ++i)