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

Example Implementation does not include code for reversed output #7

Closed solomonbstoner closed 3 years ago

solomonbstoner commented 3 years ago

The example implemented printed when --verbose true does not include the code for reversed output. The output reflection function had to be manually included.

// Function that reflects its argument
my_crc_basic::value_type my_crc_basic::reflect(value_type  x ) const {

  value_type        reflection = 0;
  value_type const  one = 1;

  for( std::size_t i = 0 ; i < width_ ; ++i, x >>= 1 ) {
    if ( x & one ) {
      reflection |= ( one << (width_ - 1u - i) );
    }
  }

  return reflection;
}
nitram2342 commented 3 years ago

Thank you very much for your feedback. It's true, that part is missing and maybe other ways to use the CRC, too.

solomonbstoner commented 3 years ago

Hi Martin! Thanks for accepting my PR. Assign this issue to me. Ill work something out

nitram2342 commented 3 years ago

Thank you very much for your support and offer. I'll transfer the issue to you.

solomonbstoner commented 3 years ago

@nitram2342 could you review my PR, please?