nitram2342 / bruteforce-crc

Brute-forcing CRC parameters
http://sitsec.net/blog/2012/02/10/brute-forcing-crc-parameters/
Boost Software License 1.0
65 stars 13 forks source link

bf_crc: Add final XOR and refout to example impl #8

Closed solomonbstoner closed 3 years ago

solomonbstoner commented 3 years ago

This commit makes the following changes to the example implementation of the CRC.

  1. Fix the refin bug when FEEDING is wrongly set as STANDARD_FEEDING when reflected input is activated under the feeding type of AUTO.
  2. Add refout by adding the function reflect_output when reflected output is activated. Fixes #7.
  3. Add final xor in the crc function before returning the crc.

Signed-off-by: Solomon Tan solomonbstoner@yahoo.com.au

solomonbstoner commented 3 years ago

Replaced my tabs with your four spaces in the force-pushes to keep indentation constant

solomonbstoner commented 3 years ago

The CRC output should now match when copied and pasted as is and compiled with GCC. It solved my issue #7. Not sure how to test it for other cases like CRCs with irregular widths