summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-08-16 23:00:35 +0200
committerZach Hilman <zachhilman@gmail.com>2018-08-23 17:52:44 +0200
commit10e5356e9ac5756d8a48498cd1270862d3013476 (patch)
treeb09c587d60e6b209c08b2ec2c4a7cdc65fab1005 /src
parentctr_encryption_layer: Fix bug when transcoding small data (diff)
downloadyuzu-10e5356e9ac5756d8a48498cd1270862d3013476.tar
yuzu-10e5356e9ac5756d8a48498cd1270862d3013476.tar.gz
yuzu-10e5356e9ac5756d8a48498cd1270862d3013476.tar.bz2
yuzu-10e5356e9ac5756d8a48498cd1270862d3013476.tar.lz
yuzu-10e5356e9ac5756d8a48498cd1270862d3013476.tar.xz
yuzu-10e5356e9ac5756d8a48498cd1270862d3013476.tar.zst
yuzu-10e5356e9ac5756d8a48498cd1270862d3013476.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/crypto/aes_util.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/core/crypto/aes_util.cpp b/src/core/crypto/aes_util.cpp
index a9876c83e..72e4bed67 100644
--- a/src/core/crypto/aes_util.cpp
+++ b/src/core/crypto/aes_util.cpp
@@ -99,10 +99,7 @@ void AESCipher<Key, KeySize>::Transcode(const u8* src, size_t size, u8* dest, Op
template <typename Key, size_t KeySize>
void AESCipher<Key, KeySize>::XTSTranscode(const u8* src, size_t size, u8* dest, size_t sector_id,
size_t sector_size, Op op) {
- if (size % sector_size > 0) {
- LOG_CRITICAL(Crypto, "Data size must be a multiple of sector size.");
- return;
- }
+ ASSERT_MSG(size % sector_size == 0, "XTS decryption size must be a multiple of sector size.");
for (size_t i = 0; i < size; i += sector_size) {
SetIV(CalculateNintendoTweak(sector_id++));
@@ -112,4 +109,4 @@ void AESCipher<Key, KeySize>::XTSTranscode(const u8* src, size_t size, u8* dest,
template class AESCipher<Key128>;
template class AESCipher<Key256>;
-} // namespace Core::Crypto \ No newline at end of file
+} // namespace Core::Crypto