-remove async ecc key generation, not needed
[oweals/gnunet.git] / src / util / crypto_crc.c
index f86fe56969ba5785ccfc2ad1005253504c687506..ea50b636c0913e4fcf1761abf485db1e70366686 100644 (file)
@@ -27,7 +27,6 @@
  * @brief implementation of CRC16 and CRC32
  * @author Christian Grothoff
  */
-
 #include "platform.h"
 #include "gnunet_common.h"
 #include "gnunet_crypto_lib.h"
@@ -51,7 +50,7 @@ static uLong crc_table[256];
 
 /*
  * This routine writes each crc_table entry exactly once,
- * with the ccorrect final value.  Thus, it is safe to call
+ * with the correct final value.  Thus, it is safe to call
  * even on a table that someone else is using concurrently.
  */
 static void
@@ -129,10 +128,11 @@ GNUNET_CRYPTO_crc16_step (uint32_t sum, const void *buf, size_t len)
   for (; len >= 2; len -= 2)
     sum += *(hdr++);
   if (len == 1)
-    sum += *((unsigned char *) hdr);
+    sum += (*hdr) & ntohs(0xFF00);
   return sum;
 }
 
+
 /**
  * Convert results from GNUNET_CRYPTO_crc16_step to final crc16.
  *