diff options
| author | Mat M <mathew1800@gmail.com> | 2018-08-24 23:47:46 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-24 23:47:46 -0400 |
| commit | 6426b0f5514d6a7c5cc369368947eceb380bfc85 (patch) | |
| tree | b7acdc39a4344570a6f2c098c30ad20114bf84db /src/core/crypto/xts_encryption_layer.h | |
| parent | f09da5d1c97d83b7e0654785ae49179ca6cd82be (diff) | |
| parent | 6314a799aa7e20789562d2e877949dfebb6194ce (diff) | |
Merge pull request #1094 from DarkLordZach/nax0
file_sys: Add support for NAX archives
Diffstat (limited to 'src/core/crypto/xts_encryption_layer.h')
| -rw-r--r-- | src/core/crypto/xts_encryption_layer.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/core/crypto/xts_encryption_layer.h b/src/core/crypto/xts_encryption_layer.h new file mode 100644 index 000000000..7a1f1dc64 --- /dev/null +++ b/src/core/crypto/xts_encryption_layer.h @@ -0,0 +1,25 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "core/crypto/aes_util.h" +#include "core/crypto/encryption_layer.h" +#include "core/crypto/key_manager.h" + +namespace Core::Crypto { + +// Sits on top of a VirtualFile and provides XTS-mode AES decription. +class XTSEncryptionLayer : public EncryptionLayer { +public: + XTSEncryptionLayer(FileSys::VirtualFile base, Key256 key); + + size_t Read(u8* data, size_t length, size_t offset) const override; + +private: + // Must be mutable as operations modify cipher contexts. + mutable AESCipher<Key256> cipher; +}; + +} // namespace Core::Crypto |
