From e0c76226ad3a100637348d822d2c5d7047f78bda Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 13 Oct 2018 09:23:34 -0400 Subject: partition_data_manager: Take package2_keys by const reference These are only ever read from, so we don't need to make a copy of all the keys here. --- src/core/crypto/partition_data_manager.cpp | 2 +- src/core/crypto/partition_data_manager.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/crypto/partition_data_manager.cpp b/src/core/crypto/partition_data_manager.cpp index e364affba..6862a0884 100644 --- a/src/core/crypto/partition_data_manager.cpp +++ b/src/core/crypto/partition_data_manager.cpp @@ -447,7 +447,7 @@ bool AttemptDecrypt(const std::array& key, Package2Header& header) { return false; } -void PartitionDataManager::DecryptPackage2(std::array, 0x20> package2_keys, +void PartitionDataManager::DecryptPackage2(const std::array& package2_keys, Package2Type type) { FileSys::VirtualFile file = std::make_shared( package2[static_cast(type)], diff --git a/src/core/crypto/partition_data_manager.h b/src/core/crypto/partition_data_manager.h index 9e448f720..0ad007c72 100644 --- a/src/core/crypto/partition_data_manager.h +++ b/src/core/crypto/partition_data_manager.h @@ -60,7 +60,8 @@ public: // Package2 bool HasPackage2(Package2Type type = Package2Type::NormalMain) const; FileSys::VirtualFile GetPackage2Raw(Package2Type type = Package2Type::NormalMain) const; - void DecryptPackage2(std::array, 0x20> package2, Package2Type type); + void DecryptPackage2(const std::array, 0x20>& package2_keys, + Package2Type type); const std::vector& GetPackage2FSDecompressed( Package2Type type = Package2Type::NormalMain) const; std::array GetKeyAreaKeyApplicationSource( -- cgit v1.2.3