summaryrefslogtreecommitdiff
path: root/src/core/crypto/aes_util.cpp
diff options
context:
space:
mode:
authorGravatar Mat M2018-08-24 23:47:46 -0400
committerGravatar GitHub2018-08-24 23:47:46 -0400
commit6426b0f5514d6a7c5cc369368947eceb380bfc85 (patch)
treeb7acdc39a4344570a6f2c098c30ad20114bf84db /src/core/crypto/aes_util.cpp
parentMerge pull request #1065 from DarkLordZach/window-title (diff)
parentfile_sys/crypto: Fix missing/unnecessary includes (diff)
downloadyuzu-6426b0f5514d6a7c5cc369368947eceb380bfc85.tar.gz
yuzu-6426b0f5514d6a7c5cc369368947eceb380bfc85.tar.xz
yuzu-6426b0f5514d6a7c5cc369368947eceb380bfc85.zip
Merge pull request #1094 from DarkLordZach/nax0
file_sys: Add support for NAX archives
Diffstat (limited to 'src/core/crypto/aes_util.cpp')
-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
99template <typename Key, size_t KeySize> 99template <typename Key, size_t KeySize>
100void AESCipher<Key, KeySize>::XTSTranscode(const u8* src, size_t size, u8* dest, size_t sector_id, 100void AESCipher<Key, KeySize>::XTSTranscode(const u8* src, size_t size, u8* dest, size_t sector_id,
101 size_t sector_size, Op op) { 101 size_t sector_size, Op op) {
102 if (size % sector_size > 0) { 102 ASSERT_MSG(size % sector_size == 0, "XTS decryption size must be a multiple of sector size.");
103 LOG_CRITICAL(Crypto, "Data size must be a multiple of sector size.");
104 return;
105 }
106 103
107 for (size_t i = 0; i < size; i += sector_size) { 104 for (size_t i = 0; i < size; i += sector_size) {
108 SetIV(CalculateNintendoTweak(sector_id++)); 105 SetIV(CalculateNintendoTweak(sector_id++));
@@ -112,4 +109,4 @@ void AESCipher<Key, KeySize>::XTSTranscode(const u8* src, size_t size, u8* dest,
112 109
113template class AESCipher<Key128>; 110template class AESCipher<Key128>;
114template class AESCipher<Key256>; 111template class AESCipher<Key256>;
115} // namespace Core::Crypto \ No newline at end of file 112} // namespace Core::Crypto