mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
Merge pull request #4494 from lioncash/transcode
aes_util: Make use of non-template variant of Transcode
This commit is contained in:
commit
0530dd6ea1
2 changed files with 3 additions and 3 deletions
|
@ -116,7 +116,7 @@ void AESCipher<Key, KeySize>::XTSTranscode(const u8* src, std::size_t size, u8*
|
||||||
|
|
||||||
for (std::size_t i = 0; i < size; i += sector_size) {
|
for (std::size_t i = 0; i < size; i += sector_size) {
|
||||||
SetIV(CalculateNintendoTweak(sector_id++));
|
SetIV(CalculateNintendoTweak(sector_id++));
|
||||||
Transcode<u8, u8>(src + i, sector_size, dest + i, op);
|
Transcode(src + i, sector_size, dest + i, op);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -367,8 +367,8 @@ static bool AttemptDecrypt(const std::array<u8, 16>& key, Package2Header& header
|
||||||
Package2Header temp = header;
|
Package2Header temp = header;
|
||||||
AESCipher<Key128> cipher(key, Mode::CTR);
|
AESCipher<Key128> cipher(key, Mode::CTR);
|
||||||
cipher.SetIV(header.header_ctr);
|
cipher.SetIV(header.header_ctr);
|
||||||
cipher.Transcode(&temp.header_ctr, sizeof(Package2Header) - 0x100, &temp.header_ctr,
|
cipher.Transcode(&temp.header_ctr, sizeof(Package2Header) - sizeof(Package2Header::signature),
|
||||||
Op::Decrypt);
|
&temp.header_ctr, Op::Decrypt);
|
||||||
if (temp.magic == Common::MakeMagic('P', 'K', '2', '1')) {
|
if (temp.magic == Common::MakeMagic('P', 'K', '2', '1')) {
|
||||||
header = temp;
|
header = temp;
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue