Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bruteforce-crc.cc: Fix errors with initial & example implementation #6

Merged
merged 2 commits into from
Jun 9, 2021

Conversation

solomonbstoner
Copy link
Contributor

@solomonbstoner solomonbstoner commented May 20, 2021

Fixes #4. Fixes #5.

  1. Since initial was declared to be uint32_t, the conversion of the
    argument should likewise be converted to uint32_t. size_t converts
    it to 8-bytes, which will not fit into 4-bytes.

  2. probe_initial should be set to false by default to prevent the
    current bug. The current bug causes the program to ignore the user
    specified value --initial x and bruteforce crc seeds.

  3. The extra byte output is a typical fence post problem. Fixed with
    this PR.

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

Fixes Issue nitram2342#4.

1. Since `initial` was declared to be `uint32_t`, the conversion of the
argument should likewise be converted to `uint32_t`. `size_t` converts
it to 8-bytes, which will not fit into 4-bytes.

2. `probe_initial` should be set to false by default to prevent the
current bug. The current bug causes the program to ignore the user
specified value `--initial x` and bruteforce crc seeds.

Signed-off-by: Solomon Tan <solomonbstoner@yahoo.com.au>
This commit fixes nitram2342#5 (ie Issue nitram2342#5). This is a classic fencepost problem.

Signed-off-by: Solomon Tan <solomonbstoner@yahoo.com.au>
@solomonbstoner
Copy link
Contributor Author

See Issues #4 and #5 for description on how PR #6 will solve them. Ready for review and merge, please.

@solomonbstoner solomonbstoner changed the title bruteforce-crc.cc: Fix errors with initial bruteforce-crc.cc: Fix errors with initial & example implementation May 21, 2021
@nitram2342 nitram2342 merged commit d32abea into nitram2342:master Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extra byte output in Example Implementation Bug and conversion error when specifying Initial
2 participants