#include <stdio.h>
#include "esp_system.h"
#include "mbedtls/aes.h"
#include <stddef.h>
#include <stdint.h>
#include "config.h"
#include <string.h>
#include <stdio.h>
#include "esp_system.h"
void app_main(void)
{
int ret = 0, i, j, u, mode;
unsigned int keybits;
unsigned char key[16]="123456789012345";
unsigned char inbuf[16]="123456789012345";
unsigned char outbuf[16]={0};
unsigned char buf[16]={0};
const unsigned char *aes_tests;
mbedtls_aes_context ctx;
//memset(key,0,16);
mbedtls_aes_init(&ctx);
for(int loop=0;loop<16;loop++)
printf("%c",key[loop]);
keybits=128;
mode=1;
printf( " AES-ECB-%3d (%s):\r\n ", keybits,
( mode == MBEDTLS_AES_DECRYPT ) ? "dec" : "enc" );
//memset( buf, 0, 16 );
//ret = mbedtls_aes_setkey_dec( &ctx, key, keybits
ESP8266&&32 AES加密、解密 (ECB方式)
最新推荐文章于 2024-06-17 09:37:38 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)