GNUnet 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 2, or (at your
+ by the Free Software Foundation; either version 3, or (at your
option) any later version.
GNUnet is distributed in the hope that it will be useful, but
* @brief implementation of CRC16 and CRC32
* @author Christian Grothoff
*/
-
#include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_crypto_lib.h"
+#include "gnunet_util_lib.h"
#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
/*
* 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
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.
*