forked from mmozeiko/pkg2zip
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpkg2zip_aes.h
More file actions
19 lines (12 loc) · 727 Bytes
/
pkg2zip_aes.h
File metadata and controls
19 lines (12 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#pragma once
#include "pkg2zip_utils.h"
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);