]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - sha256.c
some minor changes to performance testing code
[avr-crypto-lib.git] / sha256.c
index fea934028cf43a52e553dede176c19c6a1731360..bf9103bae3f25121ba52d8fcd31cde47f552845d 100644 (file)
--- a/sha256.c
+++ b/sha256.c
@@ -180,12 +180,12 @@ void sha256_lastBlock(sha256_ctx_t *state, void* block, uint16_t length){
 /*
  * length in bits!
  */
-void sha256(sha256_hash_t *dest, void* msg, uint32_t length){ /* length could be choosen longer but this is for ?C */
+void sha256(sha256_hash_t *dest, void* msg, uint32_t length){ /* length could be choosen longer but this is for ยตC */
        sha256_ctx_t s;
        sha256_init(&s);
        while(length >= SHA256_BLOCK_BITS){
                sha256_nextBlock(&s, msg);
-               msg += SHA256_BLOCK_BITS/8;
+               msg = (uint8_t*)msg + SHA256_BLOCK_BITS/8;
                length -= SHA256_BLOCK_BITS;
        }
        sha256_lastBlock(&s, msg, length);