variant v2
This commit is contained in:
parent
38874fbb0a
commit
00562631fe
5 changed files with 34 additions and 11 deletions
|
@ -45,12 +45,19 @@
|
|||
#endif
|
||||
|
||||
#define VARIANT1_1(p) \
|
||||
if (VARIANT > 0) { \
|
||||
const uint8_t tmp = reinterpret_cast<const uint8_t*>(p)[11]; \
|
||||
static const uint32_t table = 0x75310; \
|
||||
const uint8_t index = (((tmp >> 3) & 6) | (tmp & 1)) << 1; \
|
||||
((uint8_t*)(p))[11] = tmp ^ ((table >> index) & 0x30); \
|
||||
}
|
||||
if (variant > 1) \
|
||||
{ \
|
||||
const uint8_t tmp = reinterpret_cast<const uint8_t*>(p)[11]; \
|
||||
static const uint32_t table = 0x75312; \
|
||||
const uint8_t index = (((tmp >> 4) & 6) | (tmp & 1)) << 1; \
|
||||
((uint8_t*)(p))[11] = tmp ^ ((table >> index) & 0x30); \
|
||||
} \
|
||||
else{ \
|
||||
const uint8_t tmp = reinterpret_cast<const uint8_t*>(p)[11]; \
|
||||
static const uint32_t table = 0x75310; \
|
||||
const uint8_t index = (((tmp >> 3) & 6) | (tmp & 1)) << 1; \
|
||||
((uint8_t*)(p))[11] = tmp ^ ((table >> index) & 0x30); \
|
||||
}
|
||||
|
||||
#define VARIANT1_2(p, part) \
|
||||
if (VARIANT > 0) { \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue