#define v3(p) bytes2word(f9(p), fd(p), fb(p), fe(p)) const aes_32t rcon_tab[29] = { w0(0x01), w0(0x02), w0(0x04), w0(0x08), w0(0x10), w0(0x20), w0(0x40), w0(0x80), w0(0x1b), w0(0x36), w0(0x6c), w0(0xd8), w0(0xab), w0(0x4d), w0(0x9a), w0(0x2f), w0(0x5e), w0(0xbc), w0(0x63), w0(0xc6), w0(0x97), w0(0x35), w0(0x6a), w0(0xd4), w0(0xb3), w0(0x7d), w0(0xfa), w0(0xef), w0(0xc5) }; #ifdef SBX_SET const aes_08t s_box[256] = { sb_data(h0) }; #endif #ifdef ISB_SET const aes_08t inv_s_box[256] = { isb_data(h0) }; #endif #ifdef FT1_SET const aes_32t ft_tab[256] = { sb_data(u0) }; #endif #ifdef FT4_SET const aes_32t ft_tab[4][256] = { { sb_data(u0) }, { sb_data(u1) }, { sb_data(u2) }, { sb_data(u3) } }; #endif #ifdef FL1_SET const aes_32t fl_tab[256] = { sb_data(w0) };
#if RC_LENGTH > 10 w0(0x6c), w0(0xd8), w0(0xab), w0(0x4d), #endif #if RC_LENGTH > 14 w0(0x9a), w0(0x2f), w0(0x5e), w0(0xbc), w0(0x63), #endif #if RC_LENGTH > 19 w0(0xc6), w0(0x97), w0(0x35), w0(0x6a), w0(0xd4), #endif #if RC_LENGTH > 24 w0(0xb3), w0(0x7d), w0(0xfa), w0(0xef), w0(0xc5) #endif }; #ifdef SBX_SET const aes_08t t_dec(s,box)[256] = { sb_data(h0) }; #endif #ifdef ISB_SET const aes_08t t_dec(i,box)[256] = { isb_data(h0) }; #endif #ifdef FT1_SET const aes_32t t_dec(f,n)[256] = { sb_data(u0) }; #endif #ifdef FT4_SET const aes_32t t_dec(f,n)[4][256] = { { sb_data(u0) }, { sb_data(u1) }, { sb_data(u2) }, { sb_data(u3) } }; #endif #ifdef FL1_SET const aes_32t t_dec(f,l)[256] = { sb_data(w0) };
w(0x90), w(0x91), w(0x92), w(0x93), w(0x94), w(0x95), w(0x96), w(0x97),\ w(0x98), w(0x99), w(0x9a), w(0x9b), w(0x9c), w(0x9d), w(0x9e), w(0x9f),\ w(0xa0), w(0xa1), w(0xa2), w(0xa3), w(0xa4), w(0xa5), w(0xa6), w(0xa7),\ w(0xa8), w(0xa9), w(0xaa), w(0xab), w(0xac), w(0xad), w(0xae), w(0xaf),\ w(0xb0), w(0xb1), w(0xb2), w(0xb3), w(0xb4), w(0xb5), w(0xb6), w(0xb7),\ w(0xb8), w(0xb9), w(0xba), w(0xbb), w(0xbc), w(0xbd), w(0xbe), w(0xbf),\ w(0xc0), w(0xc1), w(0xc2), w(0xc3), w(0xc4), w(0xc5), w(0xc6), w(0xc7),\ w(0xc8), w(0xc9), w(0xca), w(0xcb), w(0xcc), w(0xcd), w(0xce), w(0xcf),\ w(0xd0), w(0xd1), w(0xd2), w(0xd3), w(0xd4), w(0xd5), w(0xd6), w(0xd7),\ w(0xd8), w(0xd9), w(0xda), w(0xdb), w(0xdc), w(0xdd), w(0xde), w(0xdf),\ w(0xe0), w(0xe1), w(0xe2), w(0xe3), w(0xe4), w(0xe5), w(0xe6), w(0xe7),\ w(0xe8), w(0xe9), w(0xea), w(0xeb), w(0xec), w(0xed), w(0xee), w(0xef),\ w(0xf0), w(0xf1), w(0xf2), w(0xf3), w(0xf4), w(0xf5), w(0xf6), w(0xf7),\ w(0xf8), w(0xf9), w(0xfa), w(0xfb), w(0xfc), w(0xfd), w(0xfe), w(0xff) } static const uint8_t sbox[256] = sb_data(f1); #if defined( AES_DEC_PREKEYED ) static const uint8_t isbox[256] = isb_data(f1); #endif static const uint8_t gfm2_sbox[256] = sb_data(f2); static const uint8_t gfm3_sbox[256] = sb_data(f3); #if defined( AES_DEC_PREKEYED ) static const uint8_t gfmul_9[256] = mm_data(f9); static const uint8_t gfmul_b[256] = mm_data(fb); static const uint8_t gfmul_d[256] = mm_data(fd); static const uint8_t gfmul_e[256] = mm_data(fe); #endif
#define v3(p) bytes2word(f9(p), fd(p), fb(p), fe(p)) const uint32_t rcon_tab[29] = { w0(0x01), w0(0x02), w0(0x04), w0(0x08), w0(0x10), w0(0x20), w0(0x40), w0(0x80), w0(0x1b), w0(0x36), w0(0x6c), w0(0xd8), w0(0xab), w0(0x4d), w0(0x9a), w0(0x2f), w0(0x5e), w0(0xbc), w0(0x63), w0(0xc6), w0(0x97), w0(0x35), w0(0x6a), w0(0xd4), w0(0xb3), w0(0x7d), w0(0xfa), w0(0xef), w0(0xc5) }; #ifdef SBX_SET const uint8_t s_box[256] = { sb_data(h0) }; #endif #ifdef ISB_SET const uint8_t inv_s_box[256] = { isb_data(h0) }; #endif #ifdef FT1_SET const uint32_t ft_tab[256] = { sb_data(u0) }; #endif #ifdef FT4_SET const uint32_t ft_tab[4][256] = { { sb_data(u0) }, { sb_data(u1) }, { sb_data(u2) }, { sb_data(u3) } }; #endif #ifdef FL1_SET const uint32_t fl_tab[256] = { sb_data(w0) };