Use aligned access for _sha3 module on ARM.
authorDave Jones <dave.jones@canonical.com>
Tue, 22 Feb 2022 13:54:07 +0000 (13:54 +0000)
committerMatthias Klose <doko@debian.org>
Tue, 22 Feb 2022 13:54:07 +0000 (13:54 +0000)
Gbp-Pq: Name arm-alignment.diff

Modules/_sha3/sha3module.c

index b6a7130dd86974a0c761f9541a6d555fbed4eb4c..22f5bed4402699b3a3f7246b029020c931ae2434 100644 (file)
 #define NO_MISALIGNED_ACCESSES
 #endif
 
+/* Bus error on 32-bit ARM due to un-aligned memory accesses; 64-bit ARM
+ * doesn't complain but un-aligned memory accesses are sub-optimal */
+#if defined(__arm__) || defined(__aarch64__)
+#define NO_MISALIGNED_ACCESSES 1
+#endif
+
 /* mangle names */
 #define KeccakF1600_FastLoop_Absorb _PySHA3_KeccakF1600_FastLoop_Absorb
 #define Keccak_HashFinal _PySHA3_Keccak_HashFinal