I took a python snippet from this answer (slightly modified) to calculate an ethernet crc32 frame check sequence:
msg = '00'
data = bytes.fromhex(msg)
print(data)
print(msg)
crc = zlib.crc32(data)&0xFFFFFFFF
for i in range(4):
b = (crc >> (8*i)) & 0xFF
print('{:02X}'.format(b))
For the message 00
it outputs 8D EF 02 D2
, which is the bit-reverse solution from this answer. So far so good.
Now it is said here, that
Running the CRC algorithm over the received frame data including the CRC code will always result in a zero value for error-free received data, because the CRC is a remainder of the data divided by the polynomial. However, this technique can fail to detect errors, in which data with trailing zeroes will also result in the same zero remainder. To avoid this scenario, the FCS is complemented (each bit is negated) by the sender before it is attached to the end of the payload data. This way, the algorithm result will always be a CRC32 residue of 0xC704DD7B when data has been received correctly.
But if I input 00 8D EF 02 D2
into the calculator, the result is 1C DF 44 21
, not the said residue.
I also tried other combinations, because oftentimes the bits in bytes have to be reversed or whatever (I am actually really confused about all this reversing stuff, but I hoped, a good result after trial several possibilities would guide me to the right reversals), but without any success:
00 D8 FE 20 2D -> 66 40 C3 4A
00 D2 02 EF 8D -> DF 42 14 03
00 2D 20 FE D8 -> CB 50 00 AE
So, can anyone tell me, where I am wrong?