Skip to content

Commit

Permalink
ccan: update to faster and correct crc32c implementation.
Browse files Browse the repository at this point in the history
I decided to try a faster implementation, only to find our crc32c was
not correct!  Ouch.

I removed the crc32c functions from ccan/crc, and added a new crc32c
module which has the Mark Adler x86-64-optimized variants.

We bump gossip_store version again, since csums have changed.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Jun 11, 2019
1 parent 7ce4fcd commit 0d2a483
Show file tree
Hide file tree
Showing 22 changed files with 808 additions and 697 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ CCAN_OBJS := \
ccan-bitmap.o \
ccan-bitops.o \
ccan-breakpoint.o \
ccan-crc.o \
ccan-crc32c.o \
ccan-crypto-hmac.o \
ccan-crypto-hkdf.o \
ccan-crypto-ripemd160.o \
Expand Down Expand Up @@ -123,7 +123,7 @@ CCAN_HEADERS := \
$(CCANDIR)/ccan/compiler/compiler.h \
$(CCANDIR)/ccan/container_of/container_of.h \
$(CCANDIR)/ccan/cppmagic/cppmagic.h \
$(CCANDIR)/ccan/crc/crc.h \
$(CCANDIR)/ccan/crc32c/crc32c.h \
$(CCANDIR)/ccan/crypto/hkdf_sha256/hkdf_sha256.h \
$(CCANDIR)/ccan/crypto/hmac_sha256/hmac_sha256.h \
$(CCANDIR)/ccan/crypto/ripemd160/ripemd160.h \
Expand Down Expand Up @@ -601,7 +601,7 @@ ccan-noerr.o: $(CCANDIR)/ccan/noerr/noerr.c
$(CC) $(CFLAGS) -c -o $@ $<
ccan-str-hex.o: $(CCANDIR)/ccan/str/hex/hex.c
$(CC) $(CFLAGS) -c -o $@ $<
ccan-crc.o: $(CCANDIR)/ccan/crc/crc.c
ccan-crc32c.o: $(CCANDIR)/ccan/crc32c/crc32c.c
$(CC) $(CFLAGS) -c -o $@ $<
ccan-crypto-hmac.o: $(CCANDIR)/ccan/crypto/hmac_sha256/hmac_sha256.c
$(CC) $(CFLAGS) -c -o $@ $<
Expand Down
2 changes: 1 addition & 1 deletion ccan/README
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CCAN imported from http://ccodearchive.net.

CCAN version: init-2473-g7623d082
CCAN version: init-2481-gce4660aa
15 changes: 15 additions & 0 deletions ccan/ccan/compiler/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,19 @@
#define LAST_ARG_NULL
#endif

#if HAVE_BUILTIN_CPU_SUPPORTS
/**
* cpu_supports - test if current CPU supports the named feature.
*
* This takes a literal string, and currently only works on glibc platforms.
*
* Example:
* if (cpu_supports("mmx"))
* printf("MMX support engaged!\n");
*/
#define cpu_supports(x) __builtin_cpu_supports(x)
#else
#define cpu_supports(x) 0
#endif /* HAVE_BUILTIN_CPU_SUPPORTS */

#endif /* CCAN_COMPILER_H */
1 change: 0 additions & 1 deletion ccan/ccan/crc/LICENSE

This file was deleted.

307 changes: 0 additions & 307 deletions ccan/ccan/crc/crc.c

This file was deleted.

Loading

0 comments on commit 0d2a483

Please sign in to comment.