下载后可任意编辑ARM9 嵌入式平台 AES 加密程序——hayond,2011-11-7,ChengDu一、软件平台uc/os 中,任务堆栈为 20KB,二、硬件平台ARM9 CPU:S3C2440三、主程序调用void Task4(void *pdata)//AES{char szbuf[1024], sztmp[1024]; char *pkey = "iamvingo and liveiamvingo and liveiamvingo and liveiam liveiamvingo and liveiamvingo and liveiamvingo and liveiamvingo and liveiamvingo and live"; struct aes_ctx aes; int len ; while(1) { OSPrintf("\nEnter Task4\n"); //printf("\nAESTest Start
\n "); gen_tabs(); if(aes_set_key(&aes, (const u8 *)pkey , 128)
= 0) { printf("can't set key : %s \n",pkey); } else { printf("aes_set_key() success
\n"); } printf("Please Input string to encrypt : \n"); while(Uart_GetString(szbuf) > 0 ) { len = strlen(szbuf); printf("Input len is : %d \n",len); printf("Input is :"); len=0; while(szbuf[len]) { printf(" %d",szbuf[len]);