summaryrefslogtreecommitdiffstats
path: root/src/core/crypto/key_manager.h
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-09-24 03:03:00 +0200
committerZach Hilman <zachhilman@gmail.com>2018-10-07 19:15:11 +0200
commita57aac5772bc4cfde06faa68c75e7d8ef546dbee (patch)
treead8829ed14a24865cc388b49d13005009dcafc6b /src/core/crypto/key_manager.h
parentkey_manager: Add BIS key getter (diff)
downloadyuzu-a57aac5772bc4cfde06faa68c75e7d8ef546dbee.tar
yuzu-a57aac5772bc4cfde06faa68c75e7d8ef546dbee.tar.gz
yuzu-a57aac5772bc4cfde06faa68c75e7d8ef546dbee.tar.bz2
yuzu-a57aac5772bc4cfde06faa68c75e7d8ef546dbee.tar.lz
yuzu-a57aac5772bc4cfde06faa68c75e7d8ef546dbee.tar.xz
yuzu-a57aac5772bc4cfde06faa68c75e7d8ef546dbee.tar.zst
yuzu-a57aac5772bc4cfde06faa68c75e7d8ef546dbee.zip
Diffstat (limited to '')
-rw-r--r--src/core/crypto/key_manager.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/core/crypto/key_manager.h b/src/core/crypto/key_manager.h
index a729fa7a0..8de65ec4e 100644
--- a/src/core/crypto/key_manager.h
+++ b/src/core/crypto/key_manager.h
@@ -138,9 +138,12 @@ public:
// 8*43 and the private file to exist.
void DeriveSDSeedLazy();
+ bool BaseDeriveNecessary();
+ void DeriveBase();
private:
- boost::container::flat_map<KeyIndex<S128KeyType>, Key128> s128_keys;
- boost::container::flat_map<KeyIndex<S256KeyType>, Key256> s256_keys;
+ std::map<KeyIndex<S128KeyType>, Key128> s128_keys;
+ std::map<KeyIndex<S256KeyType>, Key256> s256_keys;
+
std::array<std::array<u8, 0xB0>, 0x20> encrypted_keyblobs{};
std::array<std::array<u8, 0x90>, 0x20> keyblobs{};
@@ -148,8 +151,12 @@ private:
void LoadFromFile(const std::string& filename, bool is_title_keys);
void AttemptLoadKeyFile(const std::string& dir1, const std::string& dir2,
const std::string& filename, bool title);
- template <std::size_t Size>
- void WriteKeyToFile(bool title_key, std::string_view keyname, const std::array<u8, Size>& key);
+ template <size_t Size>
+ void WriteKeyToFile(KeyCategory category, std::string_view keyname,
+ const std::array<u8, Size>& key);
+
+ void SetKeyWrapped(S128KeyType id, Key128 key, u64 field1 = 0, u64 field2 = 0);
+ void SetKeyWrapped(S256KeyType id, Key256 key, u64 field1 = 0, u64 field2 = 0);
static const boost::container::flat_map<std::string, KeyIndex<S128KeyType>> s128_file_id;
static const boost::container::flat_map<std::string, KeyIndex<S256KeyType>> s256_file_id;