| 260 | between calls to shsUpdate() */ |
| 261 | |
| 262 | void shsUpdate(SHS_INFO* shsInfo, uint8* buffer, int count) |
| 263 | { |
| 264 | /* Update bitcount */ |
| 265 | if( ( shsInfo->countLo + ( ( uint32 ) count << 3 ) ) < shsInfo->countLo ) |
| 266 | shsInfo->countHi++; /* Carry from low to high bitCount */ |
| 267 | shsInfo->countLo += ( ( uint32 ) count << 3 ); |
| 268 | shsInfo->countHi += ( ( uint32 ) count >> 29 ); |
| 269 | |
| 270 | /* Process data in SHS_BLOCKSIZE chunks */ |
| 271 | while( count >= SHS_BLOCKSIZE ) |
| 272 | { |
| 273 | memcpy( (char *) shsInfo->data, (char *) buffer, SHS_BLOCKSIZE ); |
| 274 | #ifndef WORDS_BIGENDIAN |
| 275 | byteReverse( shsInfo->data, SHS_BLOCKSIZE ); |
| 276 | #endif /* #ifndef WORDS_BIGENDIAN */ |
| 277 | shsTransform( shsInfo ); |
| 278 | buffer += SHS_BLOCKSIZE; |
| 279 | count -= SHS_BLOCKSIZE; |
| 280 | } |
| 281 | |
| 282 | /* Handle any remaining bytes of data. This should only happen once |
| 283 | on the final lot of data */ |
| 284 | memcpy( (char *) shsInfo->data, (char *) buffer, count ); |
| 285 | } |
| 286 | |
| 287 | void shsFinal(SHS_INFO *shsInfo) |
| 288 | { |
no test coverage detected