[git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-81-g994c758
by Jussi Kivilinna
cvs at cvs.gnupg.org
Tue May 20 21:10:00 CEST 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU crypto library".
The branch, master has been updated
via 994c758d8f5471c7e9c38c2834742cca2502d35f (commit)
from bf4943932dae95a0573b63bf32a9b9acd5a6ddf3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 994c758d8f5471c7e9c38c2834742cca2502d35f
Author: Jussi Kivilinna <jussi.kivilinna at iki.fi>
Date: Tue May 20 20:35:51 2014 +0300
Fix ARM assembly when building __PIC__
* cipher/camellia-arm.S (GET_DATA_POINTER): New.
(_gcry_camellia_arm_encrypt_block): Use GET_DATA_POINTER.
(_gcry_camellia_arm_decrypt_block): Ditto.
* cipher/cast5-arm.S (GET_DATA_POINTER): New.
(_gcry_cast5_arm_encrypt_block, _gcry_cast5_arm_decrypt_block)
(_gcry_cast5_arm_enc_blk2, _gcry_cast5_arm_dec_blk2): Use
GET_DATA_POINTER.
* cipher/rijndael-arm.S (GET_DATA_POINTER): New.
(_gcry_aes_arm_encrypt_block, _gcry_aes_arm_decrypt_block): Use
GET_DATA_POINTER.
* cipher/sha1-armv7-neon.S (GET_DATA_POINTER): New.
(.LK_VEC): Move from .text to .data section.
(_gcry_sha1_transform_armv7_neon): Use GET_DATA_POINTER.
--
Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
diff --git a/cipher/camellia-arm.S b/cipher/camellia-arm.S
index 255a246..a3d87d1 100644
--- a/cipher/camellia-arm.S
+++ b/cipher/camellia-arm.S
@@ -28,6 +28,19 @@
.syntax unified
.arm
+#ifdef __PIC__
+# define GET_DATA_POINTER(reg, name, rtmp) \
+ ldr reg, 1f; \
+ ldr rtmp, 2f; \
+ b 3f; \
+ 1: .word _GLOBAL_OFFSET_TABLE_-(3f+8); \
+ 2: .word name(GOT); \
+ 3: add reg, pc, reg; \
+ ldr reg, [reg, rtmp];
+#else
+# define GET_DATA_POINTER(reg, name, rtmp) ldr reg, =name
+#endif
+
/* struct camellia_ctx: */
#define key_table 0
@@ -261,7 +274,7 @@ _gcry_camellia_arm_encrypt_block:
*/
push {%r1, %r4-%r11, %ip, %lr};
- ldr RTAB1, =.Lcamellia_sp1110;
+ GET_DATA_POINTER(RTAB1, .Lcamellia_sp1110, RTAB3);
mov RMASK, #0xff;
add RTAB3, RTAB1, #(2 * 4);
push {%r3};
@@ -309,7 +322,7 @@ _gcry_camellia_arm_decrypt_block:
*/
push {%r1, %r4-%r11, %ip, %lr};
- ldr RTAB1, =.Lcamellia_sp1110;
+ GET_DATA_POINTER(RTAB1, .Lcamellia_sp1110, RTAB3);
mov RMASK, #0xff;
add RTAB3, RTAB1, #(2 * 4);
mov RMASK, RMASK, lsl#4 /* byte mask */
diff --git a/cipher/cast5-arm.S b/cipher/cast5-arm.S
index 57c89b7..76ddd2e 100644
--- a/cipher/cast5-arm.S
+++ b/cipher/cast5-arm.S
@@ -30,6 +30,19 @@
.extern _gcry_cast5_s1to4;
+#ifdef __PIC__
+# define GET_DATA_POINTER(reg, name, rtmp) \
+ ldr reg, 1f; \
+ ldr rtmp, 2f; \
+ b 3f; \
+ 1: .word _GLOBAL_OFFSET_TABLE_-(3f+8); \
+ 2: .word name(GOT); \
+ 3: add reg, pc, reg; \
+ ldr reg, [reg, rtmp];
+#else
+# define GET_DATA_POINTER(reg, name, rtmp) ldr reg, =name
+#endif
+
/* structure of crypto context */
#define Km 0
#define Kr (Km + (16 * 4))
@@ -260,7 +273,7 @@ _gcry_cast5_arm_encrypt_block:
*/
push {%r1, %r4-%r11, %ip, %lr};
- ldr Rs1, =_gcry_cast5_s1to4;
+ GET_DATA_POINTER(Rs1, _gcry_cast5_s1to4, Rs2);
mov RMASK, #(0xff << 2);
add Rs2, Rs1, #(0x100*4);
add Rs3, Rs1, #(0x100*4*2);
@@ -306,7 +319,7 @@ _gcry_cast5_arm_decrypt_block:
*/
push {%r1, %r4-%r11, %ip, %lr};
- ldr Rs1, =_gcry_cast5_s1to4;
+ GET_DATA_POINTER(Rs1, _gcry_cast5_s1to4, Rs2);
mov RMASK, #(0xff << 2);
add Rs2, Rs1, #(0x100 * 4);
add Rs3, Rs1, #(0x100 * 4 * 2);
@@ -500,7 +513,7 @@ _gcry_cast5_arm_enc_blk2:
*/
push {%lr};
- ldr Rs1, =_gcry_cast5_s1to4;
+ GET_DATA_POINTER(Rs1, _gcry_cast5_s1to4, Rs2);
mov RMASK, #(0xff << 2);
add Rs2, Rs1, #(0x100 * 4);
@@ -631,7 +644,7 @@ _gcry_cast5_arm_dec_blk2:
* [RR0, RL0], [RR1, RL1]: dst
*/
- ldr Rs1, =_gcry_cast5_s1to4;
+ GET_DATA_POINTER(Rs1, _gcry_cast5_s1to4, Rs2);
mov RMASK, #(0xff << 2);
add Rs2, Rs1, #(0x100 * 4);
diff --git a/cipher/rijndael-arm.S b/cipher/rijndael-arm.S
index cea8c51..6004ce8 100644
--- a/cipher/rijndael-arm.S
+++ b/cipher/rijndael-arm.S
@@ -28,6 +28,19 @@
.syntax unified
.arm
+#ifdef __PIC__
+# define GET_DATA_POINTER(reg, name, rtmp) \
+ ldr reg, 1f; \
+ ldr rtmp, 2f; \
+ b 3f; \
+ 1: .word _GLOBAL_OFFSET_TABLE_-(3f+8); \
+ 2: .word name(GOT); \
+ 3: add reg, pc, reg; \
+ ldr reg, [reg, rtmp];
+#else
+# define GET_DATA_POINTER(reg, name, rtmp) ldr reg, =name
+#endif
+
/* register macros */
#define CTX %r0
#define RTAB %lr
@@ -249,7 +262,7 @@ _gcry_aes_arm_encrypt_block:
2:
sub %sp, #16;
- ldr RTAB, =.LtableE0;
+ GET_DATA_POINTER(RTAB, .LtableE0, RMASK);
str %r1, [%sp, #4]; /* dst */
mov RMASK, #0xff;
@@ -503,7 +516,7 @@ _gcry_aes_arm_decrypt_block:
2:
sub %sp, #16;
- ldr RTAB, =.LtableD0;
+ GET_DATA_POINTER(RTAB, .LtableD0, RMASK);
mov RMASK, #0xff;
str %r1, [%sp, #4]; /* dst */
diff --git a/cipher/sha1-armv7-neon.S b/cipher/sha1-armv7-neon.S
index 0c19025..95b677d 100644
--- a/cipher/sha1-armv7-neon.S
+++ b/cipher/sha1-armv7-neon.S
@@ -26,12 +26,25 @@
defined(HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS) && \
defined(HAVE_GCC_INLINE_ASM_NEON) && defined(USE_SHA1)
-.text
+.data
.syntax unified
.fpu neon
.arm
+#ifdef __PIC__
+# define GET_DATA_POINTER(reg, name, rtmp) \
+ ldr reg, 1f; \
+ ldr rtmp, 2f; \
+ b 3f; \
+ 1: .word _GLOBAL_OFFSET_TABLE_-(3f+8); \
+ 2: .word name(GOT); \
+ 3: add reg, pc, reg; \
+ ldr reg, [reg, rtmp];
+#else
+# define GET_DATA_POINTER(reg, name, rtmp) ldr reg, =name
+#endif
+
/* Context structure */
#define state_h0 0
@@ -56,6 +69,8 @@ gcry_sha1_armv7_neon_K_VEC:
.LK4: .long K4, K4, K4, K4
+.text
+
/* Register macros */
#define RSTATE r0
@@ -314,7 +329,7 @@ _gcry_sha1_transform_armv7_neon:
vpush {q4-q7};
mov ROLDSTACK, sp;
- ldr RK, =.LK_VEC;
+ GET_DATA_POINTER(RK, .LK_VEC, _a);
/* Align stack. */
sub sp, #(16*4);
-----------------------------------------------------------------------
Summary of changes:
cipher/camellia-arm.S | 17 +++++++++++++++--
cipher/cast5-arm.S | 21 +++++++++++++++++----
cipher/rijndael-arm.S | 17 +++++++++++++++--
cipher/sha1-armv7-neon.S | 19 +++++++++++++++++--
4 files changed, 64 insertions(+), 10 deletions(-)
hooks/post-receive
--
The GNU crypto library
http://git.gnupg.org
_______________________________________________
Gnupg-commits mailing list
Gnupg-commits at gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-commits
More information about the Gcrypt-devel
mailing list