summaryrefslogtreecommitdiff
path: root/tools/4/source/src/pkg2zip_aes.h
diff options
context:
space:
mode:
authorrafa_99 <rafa99@protonmail.com>2019-09-01 14:22:25 +0000
committerrafa_99 <rafa99@protonmail.com>2019-09-01 14:22:25 +0000
commitee60eb78ff7b7682395d5a799bf19ede1ff36ad3 (patch)
tree71f4be24b740c4e28863415bf1f38e57fe6343ef /tools/4/source/src/pkg2zip_aes.h
parentd2cf931fe76002da151eeedc52e2c93fbc094cb2 (diff)
Pushed stock tools and folder structure
Diffstat (limited to 'tools/4/source/src/pkg2zip_aes.h')
-rw-r--r--tools/4/source/src/pkg2zip_aes.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/4/source/src/pkg2zip_aes.h b/tools/4/source/src/pkg2zip_aes.h
new file mode 100644
index 0000000..cfd36f8
--- /dev/null
+++ b/tools/4/source/src/pkg2zip_aes.h
@@ -0,0 +1,29 @@
+#pragma once
+
+#include "pkg2zip_utils.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+typedef struct aes128_key {
+ uint32_t PKG_ALIGN(16) key[44];
+} aes128_key;
+
+void aes128_init(aes128_key* ctx, const uint8_t* key);
+void aes128_init_dec(aes128_key* ctx, const uint8_t* key);
+
+void aes128_ecb_encrypt(const aes128_key* ctx, const uint8_t* input, uint8_t* output);
+void aes128_ecb_decrypt(const aes128_key* ctx, const uint8_t* input, uint8_t* output);
+
+void aes128_ctr_xor(const aes128_key* ctx, const uint8_t* iv, uint64_t block, uint8_t* buffer, size_t size);
+
+void aes128_cmac(const uint8_t* key, const uint8_t* buffer, uint32_t size, uint8_t* mac);
+
+void aes128_psp_decrypt(const aes128_key* ctx, const uint8_t* iv, uint32_t index, uint8_t* buffer, uint32_t size);
+int aes128_supported_x86();
+
+#ifdef __cplusplus
+}
+#endif