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:
Léo Lam
2017-06-26 23:38:58 +02:00
parent aa020040f6
commit 6d821de2b9
5 changed files with 7 additions and 8 deletions

View File

@ -5,6 +5,7 @@
#include "DiscIO/VolumeWii.h"
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstring>
#include <map>
@ -97,9 +98,7 @@ VolumeWii::VolumeWii(std::unique_ptr<BlobReader> reader)
IOS::ES::TMDReader tmd{std::move(tmd_buffer)};
// Get the decryption key
const std::vector<u8> key = ticket.GetTitleKey();
if (key.size() != 16)
continue;
const std::array<u8, 16> key = ticket.GetTitleKey();
std::unique_ptr<mbedtls_aes_context> aes_context = std::make_unique<mbedtls_aes_context>();
mbedtls_aes_setkey_dec(aes_context.get(), key.data(), 128);