Make XCI comply to review and style guidelines

This commit is contained in:
Zach Hilman
2018-07-28 21:39:42 -04:00
parent 22342487e8
commit 239a3113e4
16 changed files with 223 additions and 482 deletions

View File

@ -4,19 +4,20 @@
#pragma once
#include "aes_util.h"
#include "encryption_layer.h"
#include "key_manager.h"
#include "core/crypto/aes_util.h"
#include "core/crypto/encryption_layer.h"
#include "core/crypto/key_manager.h"
namespace Crypto {
namespace Core::Crypto {
// Sits on top of a VirtualFile and provides CTR-mode AES decription.
struct CTREncryptionLayer : public EncryptionLayer {
class CTREncryptionLayer : public EncryptionLayer {
public:
CTREncryptionLayer(FileSys::VirtualFile base, Key128 key, size_t base_offset);
size_t Read(u8* data, size_t length, size_t offset) const override;
void SetIV(std::vector<u8> iv);
void SetIV(const std::vector<u8>& iv);
private:
size_t base_offset;
@ -28,4 +29,4 @@ private:
void UpdateIV(size_t offset) const;
};
} // namespace Crypto
} // namespace Core::Crypto