|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] CRC32C magic value -> shouldn't it be 0Hello there, I've been implementing CRC32C for several days now and I was NEVER able to get the results of the test cases of iSCSI draft v8. I got to a point where I worked out the math myself and the results I get are consistent. I have two implementations, one simple shifting and another with table lookup. They both yield the same results. The problem is that any legal transformations, reorderings, etc, as specified by the link, TCP, Ethernet, etc. protocols are transparent to the sender and the receiver. E.g. data sent is the same data received (assuming there was no noise or data corruption -- i.e. illegal transformations). If this is observed then I get ``magic'' value of 0 rather than 0x1c2d19ed. Here is my reasoning: In the context of pp. 150-151 of iSCSI draft v8: M(x) has been built MSB(lsb), i.e. the coefficient to x^(n-1), a_(n-1) is the LS bit of the MS Byte, ... so on to a_0 which is the MS bit of the LS byte. Let M'(x) = x^32*M(x). Then R(x) is computed as usual and then R(x) = ~R(x) as per the draft, i.e. complement the coefficeints to yield r_31, ..., r_0, which are appended in that order to the message. Call this message M''(x). Now M''(x) looks like this: M''(x) = a_(n+31)*x^(n+31) + ... + r_31*x^31 + ... + r_0. Now, this M''(x) is sent verbatim, and then received verbatim on the other end of the wire -- as mentioned above -- assuming there was no noise (all other link, Ethernet, etc. transformations are transparent to us). Now that the message has been received: Then R(x) is computed as usual and then R(x) = ~R(x) (note the algorithm symmetricity). At this point I get 0 and not 0x1c2d19ed. The reason being is that M''(x) has a remainder ~0, since the remainder was complemented before attaching it to M'(x) to form M''(x). But since we always complement, we get R(x) = ~~R(x) (once before sending and once after receiving) so the remainder is 0 as it should be. Any comments, pointers, etc. would be greatly appreciated. -l ===== -- __________________________________________________ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1
Home Last updated: Thu Nov 22 10:17:44 2001 7886 messages in chronological order |