-
Notifications
You must be signed in to change notification settings - Fork 26
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 pointer to AEAD context #29
base: master
Are you sure you want to change the base?
Conversation
Does it compile on Windows too? |
I don't see why not, but I don't have any way to verify. |
Hmm, ok. Me neither, the batch file needs updating before I can accept this PR. Maybe it's a small change. |
The crypto_aead functions with precomputation take a pointer to a `crypto_aead_aes256gcm_state` object as argument, not a char array. The compiler is changed to clang because the code with the correct pointer does not compile with GCC, see golang/go#7270.
I have changed the batch file as well. |
Is there any news on this? It doesn't compile on macos with apple-clang 9.0 either, this patch fixes it |
It's weird that it breaks GCC, Do you think there is a way to make both happy? |
That structure must be stored at a 16 bytes aligned location. The same thing applies to |
@theodelrieu GCC has an open issue for this: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81001 |
This seems to explain how to deal with alignment constraints: http://www.tapirgames.com/blog/golang-memory-alignment |
Thank you to everyone that's helping with this issue. |
Does this work for CLANG and GCC now then? |
@redragonx no, that is not possible until this GCC bug is solved. |
The crypto_aead functions with precomputation take a pointer to a
crypto_aead_aes256gcm_state
object as argument, not a char array.The compiler is changed to clang because the code with the correct pointer does
not compile with GCC, see golang/go#7270.