diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-07-30 01:00:09 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-08-01 06:16:54 +0200 |
commit | 03149d3e4a7f8038d9c88cbeb19dee25a39e0042 (patch) | |
tree | cae04a5eefd883d1a665d9502370ec5ff9faa3fd /src/core/crypto/key_manager.h | |
parent | Allow key loading from %YUZU_DIR%/keys in addition to ~/.switch (diff) | |
download | yuzu-03149d3e4a7f8038d9c88cbeb19dee25a39e0042.tar yuzu-03149d3e4a7f8038d9c88cbeb19dee25a39e0042.tar.gz yuzu-03149d3e4a7f8038d9c88cbeb19dee25a39e0042.tar.bz2 yuzu-03149d3e4a7f8038d9c88cbeb19dee25a39e0042.tar.lz yuzu-03149d3e4a7f8038d9c88cbeb19dee25a39e0042.tar.xz yuzu-03149d3e4a7f8038d9c88cbeb19dee25a39e0042.tar.zst yuzu-03149d3e4a7f8038d9c88cbeb19dee25a39e0042.zip |
Diffstat (limited to 'src/core/crypto/key_manager.h')
-rw-r--r-- | src/core/crypto/key_manager.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/crypto/key_manager.h b/src/core/crypto/key_manager.h index a52ea4cb9..28a560a3f 100644 --- a/src/core/crypto/key_manager.h +++ b/src/core/crypto/key_manager.h @@ -5,6 +5,7 @@ #pragma once #include <array> +#include <type_traits> #include <unordered_map> #include <vector> #include <fmt/format.h> @@ -50,7 +51,7 @@ struct KeyIndex { std::string DebugInfo() const { u8 key_size = 16; - if (std::is_same_v<KeyType, S256KeyType>) + if constexpr (std::is_same_v<KeyType, S256KeyType>) key_size = 32; return fmt::format("key_size={:02X}, key={:02X}, field1={:016X}, field2={:016X}", key_size, static_cast<u8>(type), field1, field2); @@ -110,7 +111,7 @@ private: void AttemptLoadKeyFile(std::string_view dir1, std::string_view dir2, std::string_view filename, bool title); - static std::unordered_map<std::string, KeyIndex<S128KeyType>> s128_file_id; - static std::unordered_map<std::string, KeyIndex<S256KeyType>> s256_file_id; + const static std::unordered_map<std::string, KeyIndex<S128KeyType>> s128_file_id; + const static std::unordered_map<std::string, KeyIndex<S256KeyType>> s256_file_id; }; } // namespace Core::Crypto |