pw_checksum: Add CRC32 support
Change-Id: Ife7a384658e1515aff2a096e3890bac6d0accfa7
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12843
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
diff --git a/pw_checksum/BUILD.gn b/pw_checksum/BUILD.gn
index 0dec534..43da086 100644
--- a/pw_checksum/BUILD.gn
+++ b/pw_checksum/BUILD.gn
@@ -24,13 +24,22 @@
pw_source_set("pw_checksum") {
public_configs = [ ":default_config" ]
- public = [ "public/pw_checksum/ccitt_crc16.h" ]
- sources = [ "ccitt_crc16.cc" ] + public
+ public = [
+ "public/pw_checksum/ccitt_crc16.h",
+ "public/pw_checksum/crc32.h",
+ ]
+ sources = [
+ "ccitt_crc16.cc",
+ "crc32.cc",
+ ]
public_deps = [ dir_pw_span ]
}
pw_test_group("tests") {
- tests = [ ":ccitt_crc16_test" ]
+ tests = [
+ ":ccitt_crc16_test",
+ ":crc32_test",
+ ]
}
pw_test("ccitt_crc16_test") {
@@ -41,6 +50,14 @@
]
}
+pw_test("crc32_test") {
+ deps = [ ":pw_checksum" ]
+ sources = [
+ "crc32_test.cc",
+ "crc32_test_c.c",
+ ]
+}
+
pw_doc_group("docs") {
sources = [ "docs.rst" ]
}