[PATCH 1/3] cipher-gcm-intel-pclmul: fix compiling with i386 gcc-4.7

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/3] cipher-gcm-intel-pclmul: fix compiling with i386 gcc-4.7

Jussi Kivilinna-2
* cipher/cipher-gcm-intel-pclmul.c (gcm_lsh): Pass '*pconst' instead of
'pconst' to asm block.
--

Signed-off-by: Jussi Kivilinna <[hidden email]>
---
 cipher/cipher-gcm-intel-pclmul.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cipher/cipher-gcm-intel-pclmul.c b/cipher/cipher-gcm-intel-pclmul.c
index 28165c65..334c89cd 100644
--- a/cipher/cipher-gcm-intel-pclmul.c
+++ b/cipher/cipher-gcm-intel-pclmul.c
@@ -397,7 +397,7 @@ static ASM_FUNC_ATTR_INLINE void gcm_lsh(void *h, unsigned int hoffs)
                 "pxor %%xmm4, %%xmm2\n\t"
                 "movdqu %%xmm2, (%[h])\n\t"
                 :
-                : [pconst] "m" (pconst),
+                : [pconst] "m" (*pconst),
                   [h] "r" ((byte *)h + hoffs)
                 : "memory" );
 }
--
2.27.0


_______________________________________________
Gcrypt-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 2/3] poly1305: fix compiling on i386 gcc-4.7

Jussi Kivilinna-2
* cipher/poly1305.c [__i386__]: Limit i386 variant of ADD_1305_32 to
GCC-5 or newer.
--

Reported-by: Horst Wente <[hidden email]>
Signed-off-by: Jussi Kivilinna <[hidden email]>
---
 cipher/poly1305.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cipher/poly1305.c b/cipher/poly1305.c
index 6cb4d2b7..da8f4601 100644
--- a/cipher/poly1305.c
+++ b/cipher/poly1305.c
@@ -310,7 +310,8 @@ static unsigned int poly1305_final (poly1305_context_t *ctx,
 
 #endif /* HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS */
 
-#if defined (__i386__) && __GNUC__ >= 4
+#if defined (__i386__) && __GNUC__ >= 5
+/* Note: ADD_1305_32 below does not compile on GCC-4.7 */
 
 /* A += B (i386) */
 #define ADD_1305_32(A4, A3, A2, A1, A0, B4, B3, B2, B1, B0) \
--
2.27.0


_______________________________________________
Gcrypt-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 3/3] poly1305: make --disable-asm work on x86, aarch64 and ppc

Jussi Kivilinna-2
In reply to this post by Jussi Kivilinna-2
* 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 <[hidden email]>
Signed-off-by: Jussi Kivilinna <[hidden email]>
---
 cipher/poly1305.c | 8 ++++----
 1 file 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) */
--
2.27.0


_______________________________________________
Gcrypt-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel