Squashed backup commit (no shallow-clone history issues) of xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream commit 9eece662e) plus all fixes applied to get everpal_defconfig building clean against a modern (GCC 15.2.0) toolchain -- see the previous commit message on the lineage-23.2 branch (also in this repo history is not available here since this is a squashed snapshot; full incremental history lives in the local DL380 checkout and the upstream GitHub remote). Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
27 lines
1007 B
C
27 lines
1007 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#include <linux/types.h>
|
|
#include <crypto/aes.h>
|
|
|
|
#define AES_BLOCK_MASK (~(AES_BLOCK_SIZE-1))
|
|
|
|
struct aes_key {
|
|
u8 key[AES_MAX_KEYLENGTH];
|
|
int rounds;
|
|
};
|
|
|
|
int aes_p8_set_encrypt_key(const u8 *userKey, const int bits,
|
|
struct aes_key *key);
|
|
int aes_p8_set_decrypt_key(const u8 *userKey, const int bits,
|
|
struct aes_key *key);
|
|
void aes_p8_encrypt(const u8 *in, u8 *out, const struct aes_key *key);
|
|
void aes_p8_decrypt(const u8 *in, u8 *out, const struct aes_key *key);
|
|
void aes_p8_cbc_encrypt(const u8 *in, u8 *out, size_t len,
|
|
const struct aes_key *key, u8 *iv, const int enc);
|
|
void aes_p8_ctr32_encrypt_blocks(const u8 *in, u8 *out,
|
|
size_t len, const struct aes_key *key,
|
|
const u8 *iv);
|
|
void aes_p8_xts_encrypt(const u8 *in, u8 *out, size_t len,
|
|
const struct aes_key *key1, const struct aes_key *key2, u8 *iv);
|
|
void aes_p8_xts_decrypt(const u8 *in, u8 *out, size_t len,
|
|
const struct aes_key *key1, const struct aes_key *key2, u8 *iv);
|