summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/content_archive.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-08-03 20:14:39 +0200
committerLioncash <mathew1800@gmail.com>2020-08-03 20:29:58 +0200
commit15660bd8570735139d91d0165a2614747f570202 (patch)
tree6886854694175d87bf33924c1799b1b46e4fd05d /src/core/file_sys/content_archive.cpp
parentipc: Allow all trivially copyable objects to be passed directly into WriteBuffer (#4465) (diff)
downloadyuzu-15660bd8570735139d91d0165a2614747f570202.tar
yuzu-15660bd8570735139d91d0165a2614747f570202.tar.gz
yuzu-15660bd8570735139d91d0165a2614747f570202.tar.bz2
yuzu-15660bd8570735139d91d0165a2614747f570202.tar.lz
yuzu-15660bd8570735139d91d0165a2614747f570202.tar.xz
yuzu-15660bd8570735139d91d0165a2614747f570202.tar.zst
yuzu-15660bd8570735139d91d0165a2614747f570202.zip
Diffstat (limited to 'src/core/file_sys/content_archive.cpp')
-rw-r--r--src/core/file_sys/content_archive.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp
index 473245d5a..5039341c7 100644
--- a/src/core/file_sys/content_archive.cpp
+++ b/src/core/file_sys/content_archive.cpp
@@ -495,9 +495,10 @@ VirtualFile NCA::Decrypt(const NCASectionHeader& s_header, VirtualFile in, u64 s
auto out = std::make_shared<Core::Crypto::CTREncryptionLayer>(std::move(in), *key,
starting_offset);
- std::vector<u8> iv(16);
- for (u8 i = 0; i < 8; ++i)
- iv[i] = s_header.raw.section_ctr[0x8 - i - 1];
+ Core::Crypto::CTREncryptionLayer::IVData iv{};
+ for (std::size_t i = 0; i < 8; ++i) {
+ iv[i] = s_header.raw.section_ctr[8 - i - 1];
+ }
out->SetIV(iv);
return std::static_pointer_cast<VfsFile>(out);
}