summaryrefslogtreecommitdiff
path: root/cipher/poly1305.c
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@iki.fi>2021-03-03 18:53:58 +0200
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2021-03-03 19:13:37 +0200
commit2b84da922660918129c610f4d27cb5c510ab0489 (patch)
tree9bd3dc68e86edc5c61971c69bd12a341f2d98749 /cipher/poly1305.c
parentbcb180190e8921356c039b0475fd71f2c45d986d (diff)
downloadlibgcrypt-2b84da922660918129c610f4d27cb5c510ab0489.tar.gz
poly1305: make --disable-asm work on x86, aarch64 and ppc
* cipher/poly1305.c [__aarch64__] (ADD_1305_64): Check for HAVE_CPU_ARCH_ARM. [__x86_64__] (ADD_1305_64): Check for HAVE_CPU_ARCH_X86. [__powerpc__] (ADD_1305_64): Check for HAVE_CPU_ARCH_PPC. [__i386__] (ADD_1305_32): Check for HAVE_CPU_ARCH_X86. -- Reported-by: Horst Wente <horst.wente@posteo.de> Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher/poly1305.c')
-rw-r--r--cipher/poly1305.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cipher/poly1305.c b/cipher/poly1305.c
index da8f4601..41e55e8d 100644
--- a/cipher/poly1305.c
+++ b/cipher/poly1305.c
@@ -105,7 +105,7 @@ static void poly1305_init (poly1305_context_t *ctx,
#ifdef USE_MPI_64BIT
-#if defined (__aarch64__) && __GNUC__ >= 4
+#if defined (__aarch64__) && defined(HAVE_CPU_ARCH_ARM) && __GNUC__ >= 4
/* A += B (armv8/aarch64) */
#define ADD_1305_64(A2, A1, A0, B2, B1, B0) \
@@ -118,7 +118,7 @@ static void poly1305_init (poly1305_context_t *ctx,
#endif /* __aarch64__ */
-#if defined (__x86_64__) && __GNUC__ >= 4
+#if defined (__x86_64__) && defined(HAVE_CPU_ARCH_X86) && __GNUC__ >= 4
/* A += B (x86-64) */
#define ADD_1305_64(A2, A1, A0, B2, B1, B0) \
@@ -131,7 +131,7 @@ static void poly1305_init (poly1305_context_t *ctx,
#endif /* __x86_64__ */
-#if defined (__powerpc__) && __GNUC__ >= 4
+#if defined (__powerpc__) && defined(HAVE_CPU_ARCH_PPC) && __GNUC__ >= 4
/* A += B (ppc64) */
#define ADD_1305_64(A2, A1, A0, B2, B1, B0) \
@@ -310,7 +310,7 @@ static unsigned int poly1305_final (poly1305_context_t *ctx,
#endif /* HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS */
-#if defined (__i386__) && __GNUC__ >= 5
+#if defined (__i386__) && defined(HAVE_CPU_ARCH_X86) && __GNUC__ >= 5
/* Note: ADD_1305_32 below does not compile on GCC-4.7 */
/* A += B (i386) */