]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - md5.c
rcfour optimized++; memxor optimized++
[avr-crypto-lib.git] / md5.c
diff --git a/md5.c b/md5.c
index 3c520edf3df83af410753fc16f8dea7fa62c2659..5edb36b84f30d34bfa4d64ed50c53003ccc8c49c 100644 (file)
--- a/md5.c
+++ b/md5.c
@@ -1,9 +1,27 @@
+/* md5.c */
+/*
+    This file is part of the Crypto-avr-lib/microcrypt-lib.
+    Copyright (C) 2008  Daniel Otte (daniel.otte@rub.de)
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
 /* 
  * \file       md5.c
  * \author     Daniel Otte
- * \date       31.07.2006
+ * \date       2006-07-31
  * \par License:
- * GPL
+ * GPLv3 or later
  * \brief Implementation of the MD5 hash algorithm as described in RFC 1321
  * 
  */
@@ -120,7 +138,7 @@ void md5_lastBlock(md5_ctx_t *state, void* block, uint16_t length){
        while (length >= 512){
                md5_nextBlock(state, block);
                length -= 512;
-               block += 512/8;
+               block = ((uint8_t*)block) + 512/8;
        }
        memset(b, 0, 64);
        memcpy(b, block, length/8);