sha256_nextBlock(&s, buffer);
while (ml >= SHA256_BLOCK_BITS){
sha256_nextBlock(&s, msg);
- msg += SHA256_BLOCK_BITS/8;
+ msg = (uint8_t*)msg + SHA256_BLOCK_BITS/8;
ml -= SHA256_BLOCK_BITS;
}
sha256_lastBlock(&s, msg, ml);
void fillBlockRandom(void* block, unsigned length){
while(length>RANDOMBLOCK_SIZE){
getRandomBlock(block);
- block += RANDOMBLOCK_SIZE;
+ block = (uint8_t*)block + RANDOMBLOCK_SIZE;
length -= RANDOMBLOCK_SIZE;
}
while(length){
*((uint8_t*)block) = getRandomByte();
- ++block; --length;
+ block= (uint8_t*)block +1; --length;
}
}
/*
*
*/
-static
void memxor(uint8_t * dest, uint8_t * src, uint8_t length){
while(length--){
*dest++ ^= *src++;
for(;r!=(enc?(rounds):-1);enc?r++:r--){ /* enc: 0..(rounds-1) ; !enc: (rounds-1)..0 */
memcpy(tb, R, 8); /* copy right half into tb */
tb[8+1] = r;
- sha256(hash, tb, 64+16+keysize);
+ sha256(&hash, tb, 64+16+keysize);
if(!(r==(enc?(rounds-1):0))){
/* swap */
memxor(hash, L, 8);