annotate crc32c.c @ 1:90cb48b87dcc

*: don't hardcode the list of impls in multiple places
author Paper <paper@tflc.us>
date Mon, 09 Feb 2026 01:18:06 -0500
parents 422835bc1aca
children 6483683ac857
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
422835bc1aca *: checkin
Paper <paper@tflc.us>
parents:
diff changeset
1 #include "crc32i.h"
422835bc1aca *: checkin
Paper <paper@tflc.us>
parents:
diff changeset
2
422835bc1aca *: checkin
Paper <paper@tflc.us>
parents:
diff changeset
3 uint32_t crc32c_r(uint32_t crc, const unsigned char *message, size_t sz)
422835bc1aca *: checkin
Paper <paper@tflc.us>
parents:
diff changeset
4 {
422835bc1aca *: checkin
Paper <paper@tflc.us>
parents:
diff changeset
5 size_t i;
422835bc1aca *: checkin
Paper <paper@tflc.us>
parents:
diff changeset
6
422835bc1aca *: checkin
Paper <paper@tflc.us>
parents:
diff changeset
7 for (i = 0; i < sz; i++)
422835bc1aca *: checkin
Paper <paper@tflc.us>
parents:
diff changeset
8 crc = (crc >> 8) ^ crc32_tab[(crc ^ message[i]) & 0xFF];
422835bc1aca *: checkin
Paper <paper@tflc.us>
parents:
diff changeset
9
422835bc1aca *: checkin
Paper <paper@tflc.us>
parents:
diff changeset
10 return crc;
422835bc1aca *: checkin
Paper <paper@tflc.us>
parents:
diff changeset
11 }