| 182 | } |
| 183 | |
| 184 | void shiftArrayLeft(unsigned char* to, const unsigned char* from, unsigned int arrayLength, unsigned int bitsToShift) |
| 185 | { |
| 186 | for (unsigned int T=0; T < arrayLength; ++T) |
| 187 | { |
| 188 | if (T >= bitsToShift/8) |
| 189 | { |
| 190 | unsigned int F = T-bitsToShift/8; |
| 191 | to[T] = from[F] << (bitsToShift%8); |
| 192 | if (T >= bitsToShift/8+1) |
| 193 | to[T] |= from[F-1] >> (8-bitsToShift%8); |
| 194 | } |
| 195 | else { |
| 196 | to[T] = 0; |
| 197 | } |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | BOOST_AUTO_TEST_CASE( shifts ) { // "<<" ">>" "<<=" ">>=" |
| 202 | unsigned char TmpArray[32]; |
no outgoing calls
no test coverage detected