| 138 | } |
| 139 | |
| 140 | static void shiftArrayLeft(unsigned char* to, const unsigned char* from, unsigned int arrayLength, unsigned int bitsToShift) |
| 141 | { |
| 142 | for (unsigned int T=0; T < arrayLength; ++T) |
| 143 | { |
| 144 | if (T >= bitsToShift/8) |
| 145 | { |
| 146 | unsigned int F = T-bitsToShift/8; |
| 147 | to[T] = uint8_t(from[F] << (bitsToShift % 8)); |
| 148 | if (T >= bitsToShift/8+1) |
| 149 | to[T] |= uint8_t(from[F - 1] >> (8 - bitsToShift % 8)); |
| 150 | } |
| 151 | else { |
| 152 | to[T] = 0; |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | BOOST_AUTO_TEST_CASE( shifts ) { // "<<" ">>" "<<=" ">>=" |
| 158 | unsigned char TmpArray[32]; |
no outgoing calls
no test coverage detected