summaryrefslogtreecommitdiffstats
path: root/src/core/crypto
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-08-06 08:34:08 +0200
committerLioncash <mathew1800@gmail.com>2020-08-06 08:34:10 +0200
commit04bb47f57f261e4e7a2280924d567683b9815c23 (patch)
tree9e404cce33216ac3e73f6b522f499ae5d7ded9d0 /src/core/crypto
parentaes_util: Make use of non-template variant of Transcode (diff)
downloadyuzu-04bb47f57f261e4e7a2280924d567683b9815c23.tar
yuzu-04bb47f57f261e4e7a2280924d567683b9815c23.tar.gz
yuzu-04bb47f57f261e4e7a2280924d567683b9815c23.tar.bz2
yuzu-04bb47f57f261e4e7a2280924d567683b9815c23.tar.lz
yuzu-04bb47f57f261e4e7a2280924d567683b9815c23.tar.xz
yuzu-04bb47f57f261e4e7a2280924d567683b9815c23.tar.zst
yuzu-04bb47f57f261e4e7a2280924d567683b9815c23.zip
Diffstat (limited to 'src/core/crypto')
-rw-r--r--src/core/crypto/partition_data_manager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/crypto/partition_data_manager.cpp b/src/core/crypto/partition_data_manager.cpp
index b31a81560..c5c073e70 100644
--- a/src/core/crypto/partition_data_manager.cpp
+++ b/src/core/crypto/partition_data_manager.cpp
@@ -349,8 +349,8 @@ static bool AttemptDecrypt(const std::array<u8, 16>& key, Package2Header& header
Package2Header temp = header;
AESCipher<Key128> cipher(key, Mode::CTR);
cipher.SetIV(header.header_ctr);
- cipher.Transcode(&temp.header_ctr, sizeof(Package2Header) - 0x100, &temp.header_ctr,
- Op::Decrypt);
+ cipher.Transcode(&temp.header_ctr, sizeof(Package2Header) - sizeof(Package2Header::signature),
+ &temp.header_ctr, Op::Decrypt);
if (temp.magic == Common::MakeMagic('P', 'K', '2', '1')) {
header = temp;
return true;