Skip to content

Conversation

@boivie
Copy link
Collaborator

@boivie boivie commented Jan 22, 2026

The crc_any is not currently imported in Chromium, and since the dcsctp library only uses a very small part of it, reimplement this ourselves.

In contrast to the crc_any crate, we generate the tables by the compiler, but similarly to it, we process 8 bytes at a time, so performance should be identical.

The correctness of this algorithm is guaranteed by test vectors and with the recorded packet captures that exist in other unit tests.

We could add an optional feature to add a dependency on the crc32c crate, which adds hardware accelerated support for some platforms, but that library is not imported in Chromium and other monorepos.

Note that the crc32c checksum becomes less relevant with support for https://datatracker.ietf.org/doc/rfc9653/, which his library has, and will use if configured and when both sides support it.

The crc_any is not currently imported in Chromium, and since the dcsctp 
library only uses a very small part of it, reimplement this ourselves.

In contrast to the crc_any crate, we generate the tables by the 
compiler, but similarly to it, we process 8 bytes at a time, so 
performance should be identical.

The correctness of this algorithm is guaranteed by test vectors and with
the recorded packet captures that exist in other unit tests.

We could add an optional feature to add a dependency on the crc32c 
crate, which adds hardware accelerated support for some platforms, but
that library is not imported in Chromium and other monorepos.

Note that the crc32c checksum becomes less relevant with support for
https://datatracker.ietf.org/doc/rfc9653/, which his library has,
and will use if configured and when both sides support it.
@boivie boivie force-pushed the feature-own-crc32 branch from 5e4b620 to 379d0a1 Compare January 23, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant