diff options
| author | bunnei <bunneidev@gmail.com> | 2020-08-05 22:35:41 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-05 22:35:41 -0400 |
| commit | 35c1607f231cab060305e79f434ef15442c162f1 (patch) | |
| tree | 0a2af713d7f5ca2b0c0bbe45176c112ae9ba2b03 /src/core/file_sys/content_archive.cpp | |
| parent | d888ac7d20e2300f9fdb595716bcfe158ea012ca (diff) | |
| parent | 15660bd8570735139d91d0165a2614747f570202 (diff) | |
Merge pull request #4484 from lioncash/aesutil
aes_util: Allow SetIV() to be non-allocating
Diffstat (limited to 'src/core/file_sys/content_archive.cpp')
| -rw-r--r-- | src/core/file_sys/content_archive.cpp | 7 |
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); } |
