Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cr-marcstevens/sha1collisiondetection.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcr-marcstevens <github@marc-stevens.nl>2019-03-11 13:48:02 +0300
committerMarc Stevens <cr-marcstevens@users.noreply.github.com>2019-03-12 19:16:18 +0300
commitf2e43b2613fc38d20867509cf62f6f00d2e13753 (patch)
treeca61699fdf694a78f3cda130bd5f8c77cd02d4db
parent232357eb2ea0397388254a4b188333a227bf5b10 (diff)
Add compiler option to force aligned access even for Intel CPUs.
-rw-r--r--lib/sha1.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sha1.c b/lib/sha1.c
index df0630b..ee38d62 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -124,10 +124,12 @@
#endif
/*ENDIANNESS SELECTION*/
+#if defined(SHA1DC_FORCE_ALIGNED_ACCESS)
+#else
#if defined(SHA1DC_FORCE_UNALIGNED_ACCESS) || defined(SHA1DC_ON_INTEL_LIKE_PROCESSOR)
#define SHA1DC_ALLOW_UNALIGNED_ACCESS
-#endif /*UNALIGNMENT DETECTION*/
-
+#endif /*UNALIGNED ACCESS DETECTION*/
+#endif /*FORCE ALIGNED ACCESS*/
#define rotate_right(x,n) (((x)>>(n))|((x)<<(32-(n))))
#define rotate_left(x,n) (((x)<<(n))|((x)>>(32-(n))))