Using only part of crc32

岁酱吖の 提交于 2019-12-08 10:32:31

问题


Will using only 2 upper/lower bytes of a crc32 sum make it weaker than crc16?

Background:

I'm currently implementing a wireless protocol. I have chunks of 64byte each, and according to Data Length vs CRC Length I would need at most crc16. Using crc16 instead of crc32 would free up bandwidth for use in Forward error correction (64byte is one block in FEC). However, my hardware is quite low powered but has hardware support for CRC32. So my idea was to use the hardware crc32 engine and just throw away 2 of the result bytes. I know that this is not a crc16 sum, but that does not matter because I control both sides of the transmission.

In case it matters: I can use both crc32 (poly 0x04C11DB7) or crc32c (poly 0x1EDC6F41).


回答1:


Yes, it will be weaker, but only for small numbers of bit errors. You get none of the guarantees of a CRC-16 by instead taking half of a CRC-32. E.g. the number of bits in a burst that are always detectable.

What is the noise source that you are trying to protect against?



来源:https://stackoverflow.com/questions/42194839/using-only-part-of-crc32

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!