summaryrefslogtreecommitdiff
path: root/src/core/crypto/key_manager.h
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-07-29 19:00:09 -0400
committerGravatar Zach Hilman2018-08-01 00:16:54 -0400
commit03149d3e4a7f8038d9c88cbeb19dee25a39e0042 (patch)
treecae04a5eefd883d1a665d9502370ec5ff9faa3fd /src/core/crypto/key_manager.h
parentAllow key loading from %YUZU_DIR%/keys in addition to ~/.switch (diff)
downloadyuzu-03149d3e4a7f8038d9c88cbeb19dee25a39e0042.tar.gz
yuzu-03149d3e4a7f8038d9c88cbeb19dee25a39e0042.tar.xz
yuzu-03149d3e4a7f8038d9c88cbeb19dee25a39e0042.zip
Add missing includes and use const where applicable
Diffstat (limited to 'src/core/crypto/key_manager.h')
-rw-r--r--src/core/crypto/key_manager.h7
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 @@
5#pragma once 5#pragma once
6 6
7#include <array> 7#include <array>
8#include <type_traits>
8#include <unordered_map> 9#include <unordered_map>
9#include <vector> 10#include <vector>
10#include <fmt/format.h> 11#include <fmt/format.h>
@@ -50,7 +51,7 @@ struct KeyIndex {
50 51
51 std::string DebugInfo() const { 52 std::string DebugInfo() const {
52 u8 key_size = 16; 53 u8 key_size = 16;
53 if (std::is_same_v<KeyType, S256KeyType>) 54 if constexpr (std::is_same_v<KeyType, S256KeyType>)
54 key_size = 32; 55 key_size = 32;
55 return fmt::format("key_size={:02X}, key={:02X}, field1={:016X}, field2={:016X}", key_size, 56 return fmt::format("key_size={:02X}, key={:02X}, field1={:016X}, field2={:016X}", key_size,
56 static_cast<u8>(type), field1, field2); 57 static_cast<u8>(type), field1, field2);
@@ -110,7 +111,7 @@ private:
110 void AttemptLoadKeyFile(std::string_view dir1, std::string_view dir2, std::string_view filename, 111 void AttemptLoadKeyFile(std::string_view dir1, std::string_view dir2, std::string_view filename,
111 bool title); 112 bool title);
112 113
113 static std::unordered_map<std::string, KeyIndex<S128KeyType>> s128_file_id; 114 const static std::unordered_map<std::string, KeyIndex<S128KeyType>> s128_file_id;
114 static std::unordered_map<std::string, KeyIndex<S256KeyType>> s256_file_id; 115 const static std::unordered_map<std::string, KeyIndex<S256KeyType>> s256_file_id;
115}; 116};
116} // namespace Core::Crypto 117} // namespace Core::Crypto