-
Notifications
You must be signed in to change notification settings - Fork 21
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
Lazy -b
evaluation
#9
Comments
Maybe consider simply limiting the maximum number of selected bits to |
previously unbounded slices such as `-b 4:` selected every input message bit after the 4th byte. for long input messages (think gigabytes) this resulted in crchack allocating crazy amounts of memory for input.bits[] array containing an element for each selected bit, ultimately freezing and/or aborting the entire program due to "out of memory" error. the commit addresses the issue by limiting the maximum number of bits selected by a single -b command-line switch to w where w is the register width of the specified CRC function. rudimentary testing shows that this does not introduce new failures when forging CRC checksums, probably because w mutable bits is practically always enough to obtain the target checksum (however, i would not be surprised if there are some edge cases where this does not hold - but let's address that separately if that problem ever comes up). lastly, this commit also implements support for negative zero offsets for command-line offset switches (-o/-O). before `-o -0` was identical to `-o 0`, whereas the expected behavior would be `-O 0`, i.e., offset pointing at the end of the input message. yes, it'd have made sense to split this change into another commit, but i'm feeling lazy so fuck it.
59e3e3d commit limits the maximum number of bits selected by a single I think we should consider deprecating offset switches Closing this issue, at least until it turns out there are some cases where the previous behavior forged some messages correctly while the new "select at most w bits" approach fails. |
Currently
-b 4:
for a long input (e.g., 1GB) is handled non-lazily by allocating a huge array to store all the input bits following the 4th byte. This is stupid. Be smarter.The text was updated successfully, but these errors were encountered: