我不明白 "A Painless Guide to CRC Error detection algorithms" 第 9 和 10 部分的一些细节

I do not understand some details in sections 9 and 10 of "A Painless Guide to CRC Error detection algorithms"

标题中的指南(下载自http://ross.net/crc/download/crc_v3.txt)完美地帮助我掌握了CRC算法的原理和手工实现。在第 9 节和第 10 节中,我遇到了可能是小问题。

9 部分我不明白的细节。 Table-Driven 实现,其中消息字节从右侧移入寄存器,在这部分(引号中的重点是我的):

• The top byte of the register now doesn't matter. No matter how many times and at what offset the poly is XORed to the top 8 bits, they will all be shifted out the right hand side during the next 8 iterations anyway.

• The remaining bits will be shifted left one position and the rightmost byte of the register will be shifted in the next byte

我认为第一个要点中的“右侧”应该是“左侧”?

在第 10 节中。一个稍微混乱的 Table-Driven 实现 , 关于处理在要检查的消息末尾附加零字节的问题,我对以下内容感到困惑:

The trouble, you see, is that this loop operates upon the AUGMENTED message and in order to use this code, you have to append W/8 zero bytes to the end of the message before pointing p at it.

这很清楚(多项式的宽度为 32),但在后面的代码中以及本节的更下方,作者使用了 W/4:

for (i=0; i<W/4; i++) r = (r << 8) ^ t[(r >> 24) & 0xFF];

我觉得这个应该也有W/8?

该文本文件中有拼写错误。最高字节很重要,因为每个 non-zero 位都会导致多项式异或到寄存器,并且该点的位正在向左移动。 W/4应该是W/8,但是在后面的例子代码中没有用到xor的数据和寄存器的高位字节索引table,递减len这是一个字节数和增量 p 这是一个指向字节的指针:

r=0; while (len--) r = (r<<8) ^ t[(r >> 24) ^ *p++];