Files
luban-lite-t3e-pro/bsp/examples/test-ce/soft-aes-ecb.h
刘可亮 0a13af6a1d V1.0.5
2024-06-04 19:00:30 +08:00

27 lines
668 B
C

/*
* Copyright (c) 2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
*/
#ifndef _SOFT_AES_ECB_H_
#define _SOFT_AES_ECB_H_
#include <stdint.h>
#include <stddef.h>
#define AES128 1
#define AES_BLOCKLEN 16 // Block length in bytes - AES is 128b block only
#define AES_KEYLEN 16 // Key length in bytes
#define AES_ROUNDKEYSIZE 176
struct aes_ctx {
unsigned char round_key[AES_ROUNDKEYSIZE];
};
void aes_init_ctx(struct aes_ctx *ctx, const unsigned char *key);
void aes_128_ecb_encrypt(const struct aes_ctx *ctx, unsigned char *buf);
void aes_128_ecb_decrypt(const struct aes_ctx *ctx, unsigned char *buf);
#endif // _SOFT_AES_ECB_H_