diff options
| author | raven02 <jacky.kktsui@yahoo.com.hk> | 2018-09-19 19:53:11 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-19 19:53:11 +0800 |
| commit | c8f9bbbf859c0e38cf691b64c67761382fcebfc2 (patch) | |
| tree | 99529c2277a6b740a6e278985c5147fa649c5497 /src/core/crypto/xts_encryption_layer.cpp | |
| parent | b91f7d5d67a67115926ad03526f71a7cc3dfb326 (diff) | |
| parent | b33ce787b7959e1bfd3b5ae4886b6e137fb97711 (diff) | |
Merge branch 'master' into tlds
Diffstat (limited to 'src/core/crypto/xts_encryption_layer.cpp')
| -rw-r--r-- | src/core/crypto/xts_encryption_layer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/crypto/xts_encryption_layer.cpp b/src/core/crypto/xts_encryption_layer.cpp index c10832cfe..8f0ba4ee7 100644 --- a/src/core/crypto/xts_encryption_layer.cpp +++ b/src/core/crypto/xts_encryption_layer.cpp @@ -14,7 +14,7 @@ constexpr u64 XTS_SECTOR_SIZE = 0x4000; XTSEncryptionLayer::XTSEncryptionLayer(FileSys::VirtualFile base_, Key256 key_) : EncryptionLayer(std::move(base_)), cipher(key_, Mode::XTS) {} -size_t XTSEncryptionLayer::Read(u8* data, size_t length, size_t offset) const { +std::size_t XTSEncryptionLayer::Read(u8* data, std::size_t length, std::size_t offset) const { if (length == 0) return 0; @@ -46,7 +46,7 @@ size_t XTSEncryptionLayer::Read(u8* data, size_t length, size_t offset) const { block.resize(XTS_SECTOR_SIZE); cipher.XTSTranscode(block.data(), block.size(), block.data(), (offset - sector_offset) / XTS_SECTOR_SIZE, XTS_SECTOR_SIZE, Op::Decrypt); - const size_t read = XTS_SECTOR_SIZE - sector_offset; + const std::size_t read = XTS_SECTOR_SIZE - sector_offset; if (length + sector_offset < XTS_SECTOR_SIZE) { std::memcpy(data, block.data() + sector_offset, std::min<u64>(length, read)); |
