代码拉取完成,页面将自动刷新
/*
* @Author : Zhaoyu.Wu
* @Date : 2021-10-09 16:53
* @LastEditTime : 2021-10-14 15:22
* @LastEditors : Zhaoyu.Wu
* @Description :
* @FilePath : /application/aes/aes.h
* If you have any questions, email to zhaoyu.wu@diehl.com.
*/
#ifndef __AES_H__
#define __AES_H__
/******************************************************************************
* Include files
******************************************************************************/
#include "aes_config.h"
/* C binding of definitions if building with C++ compiler */
#ifdef __cplusplus
extern "C"
{
#endif
/******************************************************************************
* Global type definitions
******************************************************************************/
typedef enum en_aes_enable_mode
{
AesMode_Encrypt = 0u, ///< AES encrypt
AesMode_Decrypt = 1u, ///< AES decrypt
}en_aes_enable_mode_t;
typedef enum en_aes_key_type
{
AesKeyLen_128 = 0u, ///< 128 bits
AesKeyLen_192 = 1u, ///< 192 bits
AesKeyLen_256 = 2u, ///< 256 bits
}en_aes_key_len_t;
typedef enum en_aes_cpo_type
{
#if defined(CRYPTO_TYPE_AES_ECB)
AesCpoType_Ecb = 0u, ///< AES ECB encryption type
#endif
#if defined(CRYPTO_TYPE_AES_CBC)
AesCpoType_Cbc = 1u, ///< AES CBC encryption type
#endif
#if defined(CRYPTO_TYPE_AES_CFB)
AesCpoType_Cfb = 2u, ///< AES CFB encryption type
#endif
#if defined(CRYPTO_TYPE_AES_CTR)
AesCpoType_Ctr = 3u, ///< AES CTR encryption type
#endif
#if defined(CRYPTO_TYPE_AES_OFB)
AesCpoType_Ofb = 4u, ///< AES OFB encryption type
#endif
} en_aes_cpo_type_t;
typedef struct
{
unsigned char* pu8InputByte; ///< AES 密文指针
unsigned char* pu8OutputByte; ///< AES 明文指针
unsigned char* pu8Key; ///< AES 密钥指针
#if defined (CRYPTO_TYPE_AES_CBC)
unsigned char* pu8Ivec; ///< AES 初始化向量
#endif
//TODO: padding mode: None, PKCS7, Zero, ISO10126, Ansix923
unsigned char u8Padding; ///< AES 加密时数据长度不足时填充的数据
unsigned int u32ByteDataNum; ///< AES 待操作数据长度,以8位数据计算
en_aes_key_len_t enKeyLen; ///< AES 密钥长度类型
en_aes_cpo_type_t enCpoType; ///< AES 数据加密类型
en_aes_enable_mode_t enMode; ///< AES 加密或解密运算选择
}stc_aes_cfg_t;
char aes_crypt(stc_aes_cfg_t* pstcAesCfg);
char _basic_aes_encrypt(stc_aes_cfg_t *ctx);
char _basic_aes_decrypt(stc_aes_cfg_t *ctx);
#ifdef __cplusplus
}
#endif
#endif /* __AES_H__ */
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。