Wei Dai's modification to Richard Outerbridge's initial permutation algorithm, this one is faster if you have access to rotate instructions (like in MSVC)
| 74 | // algorithm, this one is faster if you have access to rotate instructions |
| 75 | // (like in MSVC) |
| 76 | static inline void IPERM(word32 &left, word32 &right) |
| 77 | { |
| 78 | word32 work; |
| 79 | |
| 80 | right = rotlFixed(right, 4U); |
| 81 | work = (left ^ right) & 0xf0f0f0f0; |
| 82 | left ^= work; |
| 83 | right = rotrFixed(right^work, 20U); |
| 84 | work = (left ^ right) & 0xffff0000; |
| 85 | left ^= work; |
| 86 | right = rotrFixed(right^work, 18U); |
| 87 | work = (left ^ right) & 0x33333333; |
| 88 | left ^= work; |
| 89 | right = rotrFixed(right^work, 6U); |
| 90 | work = (left ^ right) & 0x00ff00ff; |
| 91 | left ^= work; |
| 92 | right = rotlFixed(right^work, 9U); |
| 93 | work = (left ^ right) & 0xaaaaaaaa; |
| 94 | left = rotlFixed(left^work, 1U); |
| 95 | right ^= work; |
| 96 | } |
| 97 | |
| 98 | static inline void FPERM(word32 &left, word32 &right) |
| 99 | { |
no test coverage detected