diff options
| author | 2018-07-28 21:39:42 -0400 | |
|---|---|---|
| committer | 2018-08-01 00:16:54 -0400 | |
| commit | 239a3113e4c6a53a2c7b12e67a0f21afae24b0aa (patch) | |
| tree | 027bc4288f08be240d0b9b2a5f6c6431e76b8b4f /src/core/crypto/aes_util.h | |
| parent | Extract mbedtls to cpp file (diff) | |
| download | yuzu-239a3113e4c6a53a2c7b12e67a0f21afae24b0aa.tar.gz yuzu-239a3113e4c6a53a2c7b12e67a0f21afae24b0aa.tar.xz yuzu-239a3113e4c6a53a2c7b12e67a0f21afae24b0aa.zip | |
Make XCI comply to review and style guidelines
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 { | |||
| 20 | Decrypt, | 20 | Decrypt, |
| 21 | }; | 21 | }; |
| 22 | 22 | ||
| 23 | struct mbedtls_cipher_context_t; | 23 | struct CipherContext; |
| 24 | 24 | ||
| 25 | template <typename Key, size_t KeySize = sizeof(Key)> | 25 | template <typename Key, size_t KeySize = sizeof(Key)> |
| 26 | class AESCipher { | 26 | class AESCipher { |
| @@ -44,15 +44,16 @@ public: | |||
| 44 | template <typename Source, typename Dest> | 44 | template <typename Source, typename Dest> |
| 45 | void XTSTranscode(const Source* src, size_t size, Dest* dest, size_t sector_id, | 45 | void XTSTranscode(const Source* src, size_t size, Dest* dest, size_t sector_id, |
| 46 | size_t sector_size, Op op) { | 46 | size_t sector_size, Op op) { |
| 47 | XTSTranscode(reinterpret_cast<const u8*>(src), size, reinterpret_cast<u8*>(dest), sector_id, sector_size, op); | 47 | XTSTranscode(reinterpret_cast<const u8*>(src), size, reinterpret_cast<u8*>(dest), sector_id, |
| 48 | sector_size, op); | ||
| 48 | } | 49 | } |
| 49 | 50 | ||
| 50 | void XTSTranscode(const u8* src, size_t size, u8* dest, size_t sector_id, size_t sector_size, Op op); | 51 | void XTSTranscode(const u8* src, size_t size, u8* dest, size_t sector_id, size_t sector_size, |
| 52 | Op op); | ||
| 51 | 53 | ||
| 52 | private: | 54 | private: |
| 53 | std::unique_ptr<mbedtls_cipher_context_t> encryption_context; | 55 | std::unique_ptr<CipherContext> ctx; |
| 54 | std::unique_ptr<mbedtls_cipher_context_t> decryption_context; | ||
| 55 | 56 | ||
| 56 | static std::vector<u8> CalculateNintendoTweak(size_t sector_id); | 57 | static std::vector<u8> CalculateNintendoTweak(size_t sector_id); |
| 57 | }; | 58 | }; |
| 58 | } // namespace Crypto | 59 | } // namespace Core::Crypto |