-
Notifications
You must be signed in to change notification settings - Fork 4
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
SHA256 fixes #1
SHA256 fixes #1
Conversation
This function was completely optimized out anyways, as it only called memset() on a variable that was never read again.
Nice catch! Any idea why the data pointer to ecdsa_sha256_update() was not aligned, was not starting on word size boundaries, in the first place? Does GCC for these architectures not align uint8_t arrays to word size boundaries? Also, would have expected things to just need more CPU instructions and not to cause different results... |
@T-X A uint8_t array has the same alignment as a single uint8_t, which is 1. This is independent of the architecture (or more precisely, the ABI) - alignment differences between ABIs usually start at primitive types of size 8 or larger. Accessing a misaligned value (without things like the In the case of ecdsautils' SHA256 implementation, the misalignment can occur in two different ways:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good, just one thought from me. "Because i don't like it" counts as a valid answer.
The first commit is just cleanup.
The second commit fixes a misaligned buffer read, which causes incorrect computation of hashes on architectures with alignment requirements. This fixes the autoupdater failure on kirkwood (ARMv5TE) reported in freifunkMUC/site-ffm#415.