]> git.cryptolib.org Git - avr-crypto-lib.git/commitdiff
fixed some (warning) issues
authorbg <bg@b1d182e4-1ff8-0310-901f-bddb46175740>
Tue, 26 Jun 2007 06:03:40 +0000 (06:03 +0000)
committerbg <bg@b1d182e4-1ff8-0310-901f-bddb46175740>
Tue, 26 Jun 2007 06:03:40 +0000 (06:03 +0000)
hmac-sha256.c
prng.c
shabea.c

index e6fe3bc5bf18c1778aef59bcaa41f90b1cd61b69..2ff2c01e58fb21789d35f9768a684fbf71032ece 100644 (file)
@@ -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 7a2cdda37d2743b15da3fd54ed9200947c62fddc..ad73bdda488dd690c4e26035ce26a0550e184ff8 100644 (file)
--- 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;
        }
 }
  
index f4f823c8015e20ee7d7fb564916739c9221b2367..e2604e1f0b5af3522457eb1772e5fc9930107a7a 100644 (file)
--- 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);