CMGDK r49-rc2
|
#include <hgl/type/DataType.H>
组合类型 | |
struct | aes_context |
名字空间 | |
namespace | hgl |
__MAKE_HGL__&&!__MAKE_PLUGIN__ | |
宏定义 | |
#define | FT |
#define | V(a, b, c, d) 0x##a##b##c##d |
#define | V(a, b, c, d) 0x##d##a##b##c |
#define | V(a, b, c, d) 0x##c##d##a##b |
#define | V(a, b, c, d) 0x##b##c##d##a |
#define | RT |
#define | V(a, b, c, d) 0x##a##b##c##d |
#define | V(a, b, c, d) 0x##d##a##b##c |
#define | V(a, b, c, d) 0x##c##d##a##b |
#define | V(a, b, c, d) 0x##b##c##d##a |
#define | GET_UINT32(n, b, i) |
#define | PUT_UINT32(n, b, i) |
#define | FROUND(X0, X1, X2, X3, Y0, Y1, Y2, Y3) |
#define | RROUND(X0, X1, X2, X3, Y0, Y1, Y2, Y3) |
函数 | |
int | aes_set_key (struct aes_context *ctx, unsigned char *key, int nbits) |
void | aes_encrypt (struct aes_context *ctx, unsigned char data[16]) |
void | aes_decrypt (struct aes_context *ctx, unsigned char data[16]) |
void | hgl::AesEncrypt (uint8[16], uint8 *, int) |
void | hgl::AesDecrypt (uint8[16], uint8 *, int) |
#define FROUND | ( | X0, | |
X1, | |||
X2, | |||
X3, | |||
Y0, | |||
Y1, | |||
Y2, | |||
Y3 | |||
) |
{ \ RK += 4; \ \ X0 = RK[0] ^ FT0[ (unsigned __int8) ( Y0 >> 24 ) ] ^ \ FT1[ (unsigned __int8) ( Y1 >> 16 ) ] ^ \ FT2[ (unsigned __int8) ( Y2 >> 8 ) ] ^ \ FT3[ (unsigned __int8) ( Y3 ) ]; \ \ X1 = RK[1] ^ FT0[ (unsigned __int8) ( Y1 >> 24 ) ] ^ \ FT1[ (unsigned __int8) ( Y2 >> 16 ) ] ^ \ FT2[ (unsigned __int8) ( Y3 >> 8 ) ] ^ \ FT3[ (unsigned __int8) ( Y0 ) ]; \ \ X2 = RK[2] ^ FT0[ (unsigned __int8) ( Y2 >> 24 ) ] ^ \ FT1[ (unsigned __int8) ( Y3 >> 16 ) ] ^ \ FT2[ (unsigned __int8) ( Y0 >> 8 ) ] ^ \ FT3[ (unsigned __int8) ( Y1 ) ]; \ \ X3 = RK[3] ^ FT0[ (unsigned __int8) ( Y3 >> 24 ) ] ^ \ FT1[ (unsigned __int8) ( Y0 >> 16 ) ] ^ \ FT2[ (unsigned __int8) ( Y1 >> 8 ) ] ^ \ FT3[ (unsigned __int8) ( Y2 ) ]; \ }
#define FT |
#define RROUND | ( | X0, | |
X1, | |||
X2, | |||
X3, | |||
Y0, | |||
Y1, | |||
Y2, | |||
Y3 | |||
) |
{ \ RK += 4; \ \ X0 = RK[0] ^ RT0[ (unsigned __int8) ( Y0 >> 24 ) ] ^ \ RT1[ (unsigned __int8) ( Y3 >> 16 ) ] ^ \ RT2[ (unsigned __int8) ( Y2 >> 8 ) ] ^ \ RT3[ (unsigned __int8) ( Y1 ) ]; \ \ X1 = RK[1] ^ RT0[ (unsigned __int8) ( Y1 >> 24 ) ] ^ \ RT1[ (unsigned __int8) ( Y0 >> 16 ) ] ^ \ RT2[ (unsigned __int8) ( Y3 >> 8 ) ] ^ \ RT3[ (unsigned __int8) ( Y2 ) ]; \ \ X2 = RK[2] ^ RT0[ (unsigned __int8) ( Y2 >> 24 ) ] ^ \ RT1[ (unsigned __int8) ( Y1 >> 16 ) ] ^ \ RT2[ (unsigned __int8) ( Y0 >> 8 ) ] ^ \ RT3[ (unsigned __int8) ( Y3 ) ]; \ \ X3 = RK[3] ^ RT0[ (unsigned __int8) ( Y3 >> 24 ) ] ^ \ RT1[ (unsigned __int8) ( Y2 >> 16 ) ] ^ \ RT2[ (unsigned __int8) ( Y1 >> 8 ) ] ^ \ RT3[ (unsigned __int8) ( Y0 ) ]; \ }
#define RT |
void aes_decrypt | ( | struct aes_context * | ctx, |
unsigned char | data[16] | ||
) |
void aes_encrypt | ( | struct aes_context * | ctx, |
unsigned char | data[16] | ||
) |
int aes_set_key | ( | struct aes_context * | ctx, |
unsigned char * | key, | ||
int | nbits | ||
) |