diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-07-29 03:39:42 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-08-01 06:16:54 +0200 |
commit | 239a3113e4c6a53a2c7b12e67a0f21afae24b0aa (patch) | |
tree | 027bc4288f08be240d0b9b2a5f6c6431e76b8b4f /src/core/crypto/aes_util.h | |
parent | Extract mbedtls to cpp file (diff) | |
download | yuzu-239a3113e4c6a53a2c7b12e67a0f21afae24b0aa.tar yuzu-239a3113e4c6a53a2c7b12e67a0f21afae24b0aa.tar.gz yuzu-239a3113e4c6a53a2c7b12e67a0f21afae24b0aa.tar.bz2 yuzu-239a3113e4c6a53a2c7b12e67a0f21afae24b0aa.tar.lz yuzu-239a3113e4c6a53a2c7b12e67a0f21afae24b0aa.tar.xz yuzu-239a3113e4c6a53a2c7b12e67a0f21afae24b0aa.tar.zst yuzu-239a3113e4c6a53a2c7b12e67a0f21afae24b0aa.zip |
Diffstat (limited to 'src/core/crypto/aes_util.h')
-rw-r--r-- | src/core/crypto/aes_util.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/crypto/aes_util.h b/src/core/crypto/aes_util.h index 5c09718b2..fa77d5560 100644 --- a/src/core/crypto/aes_util.h +++ b/src/core/crypto/aes_util.h @@ -20,7 +20,7 @@ enum class Op { Decrypt, }; -struct mbedtls_cipher_context_t; +struct CipherContext; template <typename Key, size_t KeySize = sizeof(Key)> class AESCipher { @@ -44,15 +44,16 @@ public: template <typename Source, typename Dest> void XTSTranscode(const Source* src, size_t size, Dest* dest, size_t sector_id, size_t sector_size, Op op) { - XTSTranscode(reinterpret_cast<const u8*>(src), size, reinterpret_cast<u8*>(dest), sector_id, sector_size, op); + XTSTranscode(reinterpret_cast<const u8*>(src), size, reinterpret_cast<u8*>(dest), sector_id, + sector_size, op); } - void XTSTranscode(const u8* src, size_t size, u8* dest, size_t sector_id, size_t sector_size, Op op); + void XTSTranscode(const u8* src, size_t size, u8* dest, size_t sector_id, size_t sector_size, + Op op); private: - std::unique_ptr<mbedtls_cipher_context_t> encryption_context; - std::unique_ptr<mbedtls_cipher_context_t> decryption_context; + std::unique_ptr<CipherContext> ctx; static std::vector<u8> CalculateNintendoTweak(size_t sector_id); }; -} // namespace Crypto +} // namespace Core::Crypto |