summaryrefslogtreecommitdiffstats
path: root/src/core/hw/aes/key.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hw/aes/key.h')
-rw-r--r--src/core/hw/aes/key.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/core/hw/aes/key.h b/src/core/hw/aes/key.h
new file mode 100644
index 000000000..b01d04f13
--- /dev/null
+++ b/src/core/hw/aes/key.h
@@ -0,0 +1,35 @@
+// Copyright 2017 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include <array>
+#include <cstddef>
+#include "common/common_types.h"
+
+namespace HW {
+namespace AES {
+
+enum KeySlotID : size_t {
+ APTWrap = 0x31,
+
+ MaxKeySlotID = 0x40,
+};
+
+constexpr size_t AES_BLOCK_SIZE = 16;
+
+using AESKey = std::array<u8, AES_BLOCK_SIZE>;
+
+void InitKeys();
+
+void SetGeneratorConstant(const AESKey& key);
+void SetKeyX(size_t slot_id, const AESKey& key);
+void SetKeyY(size_t slot_id, const AESKey& key);
+void SetNormalKey(size_t slot_id, const AESKey& key);
+
+bool IsNormalKeyAvailable(size_t slot_id);
+AESKey GetNormalKey(size_t slot_id);
+
+} // namspace AES
+} // namespace HW