|
|
|
@ -282,8 +282,23 @@ Key256 KeyManager::GetKey(S256KeyType id, u64 field1, u64 field2) const { |
|
|
|
return s256_keys.at({id, field1, field2}); |
|
|
|
} |
|
|
|
|
|
|
|
template <std::size_t Size> |
|
|
|
void KeyManager::WriteKeyToFile(bool title_key, std::string_view keyname, |
|
|
|
Key256 KeyManager::GetBISKey(u8 partition_id) const { |
|
|
|
Key256 out{}; |
|
|
|
|
|
|
|
for (const auto& bis_type : {BISKeyType::Crypto, BISKeyType::Tweak}) { |
|
|
|
if (HasKey(S128KeyType::BIS, partition_id, static_cast<u64>(bis_type))) { |
|
|
|
std::memcpy( |
|
|
|
out.data() + sizeof(Key128) * static_cast<u64>(bis_type), |
|
|
|
s128_keys.at({S128KeyType::BIS, partition_id, static_cast<u64>(bis_type)}).data(), |
|
|
|
sizeof(Key128)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return out; |
|
|
|
} |
|
|
|
|
|
|
|
template <size_t Size> |
|
|
|
void KeyManager::WriteKeyToFile(KeyCategory category, std::string_view keyname, |
|
|
|
const std::array<u8, Size>& key) { |
|
|
|
const std::string yuzu_keys_dir = FileUtil::GetUserPath(FileUtil::UserPath::KeysDir); |
|
|
|
std::string filename = "title.keys_autogenerated"; |
|
|
|
|