Simplify xtime

This commit is contained in:
Phillip Stephens 2015-07-26 17:08:35 -07:00
parent 04e6381eed
commit ebb5c0743d
1 changed files with 1 additions and 8 deletions

View File

@ -40,14 +40,7 @@ static inline void unpack(uint32_t a, uint8_t* b)
static inline uint8_t xtime(uint8_t a) static inline uint8_t xtime(uint8_t a)
{ {
uint8_t b; return ((a << 1) ^ (((a>>7) & 1) * 0x11B));
if (a & 0x80) b = 0x1B;
else b = 0;
a <<= 1;
a ^= b;
return a;
} }
static const struct SoftwareAESTables static const struct SoftwareAESTables