From: bg Date: Tue, 26 Jun 2007 06:03:40 +0000 (+0000) Subject: fixed some (warning) issues X-Git-Url: https://git.cryptolib.org/?a=commitdiff_plain;h=9f110487604e4c7778bda498017bfe6b52c69a1f;p=avr-crypto-lib.git fixed some (warning) issues --- diff --git a/hmac-sha256.c b/hmac-sha256.c index e6fe3bc..2ff2c01 100644 --- a/hmac-sha256.c +++ b/hmac-sha256.c @@ -95,7 +95,7 @@ void hmac_sha256(void* dest, void* key, uint16_t kl, void* msg, uint64_t ml){ /* 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); diff --git a/prng.c b/prng.c index 7a2cdda..ad73bdd 100644 --- a/prng.c +++ b/prng.c @@ -140,12 +140,12 @@ uint8_t getRandomByte(void){ 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; } } diff --git a/shabea.c b/shabea.c index f4f823c..e2604e1 100644 --- a/shabea.c +++ b/shabea.c @@ -20,7 +20,6 @@ /* * */ -static void memxor(uint8_t * dest, uint8_t * src, uint8_t length){ while(length--){ *dest++ ^= *src++; @@ -47,7 +46,7 @@ void shabea128(void * block, void * key, uint16_t keysize, uint8_t enc, uint8_t 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);