Skip to content

[3.10] bpo-36515: Disable unaligned memory access in _sha3 on ARM (GH-25927) #25930

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

Merged
merged 1 commit into from
May 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The :mod:`hashlib` module no longer does unaligned memory accesses when
compiled for ARM platforms.
5 changes: 5 additions & 0 deletions Modules/_sha3/sha3module.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@
#define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
#endif

/* Prevent bus errors on platforms requiring aligned accesses such ARM. */
#if HAVE_ALIGNED_REQUIRED && !defined(NO_MISALIGNED_ACCESSES)
#define NO_MISALIGNED_ACCESSES
#endif

/* mangle names */
#define KeccakF1600_FastLoop_Absorb _PySHA3_KeccakF1600_FastLoop_Absorb
#define Keccak_HashFinal _PySHA3_Keccak_HashFinal
Expand Down