资源简介
AES128-cbc快速查表法,c语言,使用查表进行实现,采用空间换时间的方法,大大减少了加密所需要的时间。亲手写完。
代码片段和文件信息
#include
#include
#include
#include
#define MAX_LINE 1281
#define MAX_DE_LINE 1313
#include
#define BUILD_UINT32(Byte3 Byte2 Byte1 Byte0) \
((uint32_t)((uint32_t)((Byte0) & 0x00FF) \
+ ((uint32_t)((Byte1) & 0x00FF) << 8) \
+ ((uint32_t)((Byte2) & 0x00FF) << 16) \
+ ((uint32_t)((Byte3) & 0x00FF) << 24)))
typedef uint32_t u32_t;
void ByteToBits(unsigned char ch unsigned char bit[]);//2
void SubBytes(unsigned char status[][4] unsigned char bit[]);//3
void Inv_SubBytes(unsigned char status[][4] unsigned char bit[]);//4
void ShiftRows(unsigned char status[][4]);//5
void Inv_ShiftRows(unsigned char status[][4]);//6
unsigned char ByteMultiply(unsigned char c);//7
void MixColumns(unsigned char status[][4]);//8
void Inv_MixColumns(unsigned
评论
共有 条评论