Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36624 )
Change subject: lib: add calculate crc byte by byte ......................................................................
Patch Set 3:
(3 comments)
https://review.coreboot.org/c/coreboot/+/36624/1/src/include/crc_byte.h File src/include/crc_byte.h:
https://review.coreboot.org/c/coreboot/+/36624/1/src/include/crc_byte.h@33 PS1, Line 33: uint16_t crc16_byte(uint16_t prev_crc, uint8_t data);
Please document the exact polynomials implemented by these functions, there exist multiple common ve […]
Done
https://review.coreboot.org/c/coreboot/+/36624/1/src/lib/crc_byte.c File src/lib/crc_byte.c:
https://review.coreboot.org/c/coreboot/+/36624/1/src/lib/crc_byte.c@18 PS1, Line 18: static const uint8_t crc7_table[256] = {
Is there a reason these need to be table-based implementations? Can you just implement the CRC algor […]
Done
https://review.coreboot.org/c/coreboot/+/36624/1/src/lib/crc_byte.c@53 PS1, Line 53: uint8_t crc7_byte(uint8_t crc, uint8_t data)
Is this really a CRC-7? Looks to me like it's consuming 8 bits at once, wouldn't that make it a CRC- […]
The naming convention for CRC-n isn't a word width (they all operate on bitstreams, even if they're bundled up like here). Instead, n is the highest exponent in the polynomial (here: x^7+x^3+1).