mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
IOS: Use a std::array for the title key instead of vector
The title key is always 16 bytes, so it doesn't make sense to make it a std::vector.
This commit is contained in:
@ -80,7 +80,7 @@ public:
|
||||
|
||||
bool valid = false;
|
||||
IOS::ES::TMDReader tmd;
|
||||
std::vector<u8> title_key;
|
||||
std::array<u8, 16> title_key;
|
||||
std::map<u32, ExportContent> contents;
|
||||
};
|
||||
|
||||
|
@ -380,7 +380,7 @@ u64 TicketReader::GetTitleId() const
|
||||
return Common::swap64(m_bytes.data() + offsetof(Ticket, title_id));
|
||||
}
|
||||
|
||||
std::vector<u8> TicketReader::GetTitleKey() const
|
||||
std::array<u8, 16> TicketReader::GetTitleKey() const
|
||||
{
|
||||
u8 iv[16] = {};
|
||||
std::copy_n(&m_bytes[offsetof(Ticket, title_id)], sizeof(Ticket::title_id), iv);
|
||||
@ -398,7 +398,7 @@ std::vector<u8> TicketReader::GetTitleKey() const
|
||||
const HLE::IOSC::ConsoleType console_type =
|
||||
is_rvt ? HLE::IOSC::ConsoleType::RVT : HLE::IOSC::ConsoleType::Retail;
|
||||
|
||||
std::vector<u8> key(16);
|
||||
std::array<u8, 16> key;
|
||||
HLE::IOSC iosc(console_type);
|
||||
iosc.Decrypt(common_key_handle, iv, &m_bytes[offsetof(Ticket, title_key)], 16, key.data(),
|
||||
HLE::PID_ES);
|
||||
|
@ -222,7 +222,7 @@ public:
|
||||
|
||||
u32 GetDeviceId() const;
|
||||
u64 GetTitleId() const;
|
||||
std::vector<u8> GetTitleKey() const;
|
||||
std::array<u8, 16> GetTitleKey() const;
|
||||
|
||||
// Deletes a ticket with the given ticket ID from the internal buffer.
|
||||
void DeleteTicket(u64 ticket_id);
|
||||
|
Reference in New Issue
Block a user