質問

I'm writing test harness for an CRC calculation library and I'm looking for reference test vectors for CRC-32C. I found plenty for CRC-32 but nothing for CRC-32C specifically. Could somebody point me to a reference?

I managed to calculate these values using online calculator from this url:

crc32c("") = 0
crc32c("The quick brown fox jumps over the lazy dog") = 0x22620404

However, I'm not even sure if my setup is correct. All I need is a reference to a reliable source that would provide few test vectors like this.

役に立ちましたか?

解決

This CRC catalog provides the check value of 0xe3069283 for a CRC-32C of the sequence of ASCII characters: "123456789" (without the quotes).

他のヒント

Here are test data from RFC3720, which uses crc32c.

https://www.rfc-editor.org/rfc/rfc3720#appendix-B.4

Here's a "mee too" answer with some values you can use without parsing standards. The were cross checked with Adler's MAKECRC.C and Intel's CRC intrinsics.

Adler's implementation was modified to use the the 0x82F63B78 polynomial, which has the following coefficients:

/* terms of polynomial defining this crc (except x^32): */
static int p[] = {0,6,8,9,10,11,13,14,18,19,20,22,23,25,26,27,28};

Below are String/CRC-32C pairs. Pay attention to endianess. The answers below were extracted byte-by-byte on a little-endian machine, just like a conventional digest would be presented.

{"", "\x00\x00\x00\x00"}
{"a", "\x30\x43\xd0\xc1"}
{"abc", "\xb7\x3f\x4b\x36"}
{"message digest", "\xd0\x79\xbd\x02"}
{"abcdefghijklmnopqrstuvwxyz", "\x25\xef\xe6\x9e"}
{"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", "\x7d\xd5\x45\xa2"}
{"12345678901234567890123456789012345678901234567890123456789012345678901234567890", "\x81\x67\x7a\x47"}
{"123456789", "\x83\x92\x06\xe3"}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top