diff options
| author | JosJuice <josjuice@gmail.com> | 2017-02-10 16:56:40 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2017-02-11 12:56:48 +0100 |
| commit | c96bcace2f64796a5098b58ae620a158e9d3e9dc (patch) | |
| tree | 6e9c4ebd634b7a2cb4ebd0cfe807ecfa0a074a7d /Source/Core/DiscIO/VolumeWiiCrypted.cpp | |
| parent | fb2098917b7fcbe64c8287019aa877b0a860dd0d (diff) | |
VolumeWiiCrypted: Use constant naming style for constants
Diffstat (limited to 'Source/Core/DiscIO/VolumeWiiCrypted.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeWiiCrypted.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp index 7976e1d758..cb5fe4464f 100644 --- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp +++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp @@ -60,26 +60,26 @@ bool CVolumeWiiCrypted::Read(u64 _ReadOffset, u64 _Length, u8* _pBuffer, bool de FileMon::FindFilename(_ReadOffset); - std::vector<u8> read_buffer(s_block_total_size); + std::vector<u8> read_buffer(BLOCK_TOTAL_SIZE); while (_Length > 0) { // Calculate block offset - u64 Block = _ReadOffset / s_block_data_size; - u64 Offset = _ReadOffset % s_block_data_size; + u64 Block = _ReadOffset / BLOCK_DATA_SIZE; + u64 Offset = _ReadOffset % BLOCK_DATA_SIZE; if (m_LastDecryptedBlockOffset != Block) { // Read the current block - if (!m_pReader->Read(m_VolumeOffset + m_dataOffset + Block * s_block_total_size, - s_block_total_size, read_buffer.data())) + if (!m_pReader->Read(m_VolumeOffset + m_dataOffset + Block * BLOCK_TOTAL_SIZE, + BLOCK_TOTAL_SIZE, read_buffer.data())) return false; // Decrypt the block's data. // 0x3D0 - 0x3DF in m_pBuffer will be overwritten, // but that won't affect anything, because we won't // use the content of m_pBuffer anymore after this - mbedtls_aes_crypt_cbc(m_AES_ctx.get(), MBEDTLS_AES_DECRYPT, s_block_data_size, - &read_buffer[0x3D0], &read_buffer[s_block_header_size], + mbedtls_aes_crypt_cbc(m_AES_ctx.get(), MBEDTLS_AES_DECRYPT, BLOCK_DATA_SIZE, + &read_buffer[0x3D0], &read_buffer[BLOCK_HEADER_SIZE], m_LastDecryptedBlock); m_LastDecryptedBlockOffset = Block; @@ -90,7 +90,7 @@ bool CVolumeWiiCrypted::Read(u64 _ReadOffset, u64 _Length, u8* _pBuffer, bool de } // Copy the decrypted data - u64 MaxSizeToCopy = s_block_data_size - Offset; + u64 MaxSizeToCopy = BLOCK_DATA_SIZE - Offset; u64 CopySize = (_Length > MaxSizeToCopy) ? MaxSizeToCopy : _Length; memcpy(_pBuffer, &m_LastDecryptedBlock[Offset], (size_t)CopySize); |
