-
Notifications
You must be signed in to change notification settings - Fork 461
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
Fix AES-NI and other minor stuff #633
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Steffen Jaeckel <[email protected]>
Aligning a `struct` member via `attribute(align(<n>))` is not guaranteed to work. Change the approach to use an opaque buffer and always manually align the start pointers of the keys. c.f. DCIT/perl-CryptX#95 Signed-off-by: Steffen Jaeckel <[email protected]>
One can now define `LTC_NO_AES_NI` to disable AES-NI. Signed-off-by: Steffen Jaeckel <[email protected]>
This is required 1. when cross-compiling 2. to enable/disable the specific compiler warnings Tested on `bash`, `dash`, `zsh` and FreeBSD `sh`. Signed-off-by: Steffen Jaeckel <[email protected]>
In order to memory-align the used buffers for keys, IVs etc. we re-order the struct members of ciphers, modes and encauth. There's no guarantee that this works, but it improves the chances. Signed-off-by: Steffen Jaeckel <[email protected]>
``` src/encauth/ccm/ccm_memory.c: In function ‘ccm_memory’: src/encauth/ccm/ccm_memory.c:164:17: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 164 | PAD[x++] = (unsigned char)((len >> 24) & 255); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/encauth/ccm/ccm_memory.c:43:19: note: at offset 16 into destination object ‘PAD’ of size 16 43 | unsigned char PAD[16], ctr[16], CTRPAD[16], ptTag[16], b, *pt_real; | ^~~ ``` Multiple reviews and tests determined that this can't happen, but most likely computers are better in finding out such stuff (or it was a false positive). Signed-off-by: Steffen Jaeckel <[email protected]>
Reported by @pineappleiceberg in [0] [0] #577 (comment) Signed-off-by: Steffen Jaeckel <[email protected]>
Fixes e98e0a6 Signed-off-by: Steffen Jaeckel <[email protected]>
Since make version 4.3 [0] the `#` sign inside a string is handled differently. Fix that. [0] https://lists.gnu.org/archive/html/info-gnu/2020-01/msg00004.html Signed-off-by: Steffen Jaeckel <[email protected]>
karel-m
approved these changes
Oct 7, 2023
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.
looks good, passes all tests with my perl module (on all platforms in the test suite)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check commit messages for details.