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