[git] GCRYPT - branch, master, updated. libgcrypt-1.5.0-161-gd6c9c86
by Jussi Kivilinna
cvs at cvs.gnupg.org
Wed Jul 10 21:38:22 CEST 2013
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 d6c9c86cb7f571ae0bd9aee4efa01a0f9c4c3104 (commit)
via c64a0dcbefc5b0055954e37a3c86b32ff7a1b1da (commit)
via ed0a598172208ec67234a4edd73189bf6808fd04 (commit)
via c3902a6b5cea9acef2e15fbee24eb601eeb25168 (commit)
via 97f392f43cf2e4da1297cbecacbfbff33a869478 (commit)
via 8aa4f2161cf643ce36d87d2e2786b546736f8232 (commit)
via 71dda4507053379433dc8b0fc6462c15de7299df (commit)
from 6540b84a6e9113813e7e49e3ad2024d4a0073300 (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 d6c9c86cb7f571ae0bd9aee4efa01a0f9c4c3104
Author: Jussi Kivilinna <jussi.kivilinna at iki.fi>
Date: Wed Jun 26 15:28:49 2013 +0300
Fix 'Please include winsock2.h before windows.h' warnings with mingw32
* random/rndw32.c: include winsock2.h before windows.h.
* src/ath.h [_WIN32]: Ditto.
* tests/benchmark.c [_WIN32]: Ditto.
--
Patch silences warnings of following type:
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]
Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
diff --git a/random/rndw32.c b/random/rndw32.c
index f8a83b6..5c5d6c6 100644
--- a/random/rndw32.c
+++ b/random/rndw32.c
@@ -78,6 +78,7 @@
#include <stdint.h>
#endif
+#include <winsock2.h>
#include <windows.h>
diff --git a/src/ath.h b/src/ath.h
index 6ffa928..a132e0b 100644
--- a/src/ath.h
+++ b/src/ath.h
@@ -23,6 +23,7 @@
#include <config.h>
#ifdef _WIN32
+# include <winsock2.h>
# include <windows.h>
#else /* !_WIN32 */
# ifdef HAVE_SYS_SELECT_H
diff --git a/tests/benchmark.c b/tests/benchmark.c
index c4b5258..79048a3 100644
--- a/tests/benchmark.c
+++ b/tests/benchmark.c
@@ -25,6 +25,7 @@
#include <time.h>
#include <stdarg.h>
#ifdef _WIN32
+#include <winsock2.h>
#include <windows.h>
#else
#include <sys/times.h>
commit c64a0dcbefc5b0055954e37a3c86b32ff7a1b1da
Author: Jussi Kivilinna <jussi.kivilinna at iki.fi>
Date: Wed Jun 26 16:57:00 2013 +0300
Remove duplicate header from mpi/amd64/mpih-mul2.S
* mpi/amd64/mpih-mul2.S: remove duplicated header.
--
Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
diff --git a/mpi/amd64/mpih-mul2.S b/mpi/amd64/mpih-mul2.S
index 1180f76..a332a1d 100644
--- a/mpi/amd64/mpih-mul2.S
+++ b/mpi/amd64/mpih-mul2.S
@@ -31,49 +31,6 @@
#include "sysdep.h"
#include "asm-syntax.h"
-
-/*******************
- * mpi_limb_t
- * _gcry_mpih_addmul_2( mpi_ptr_t res_ptr, (sp + 4)
- * mpi_ptr_t s1_ptr, (sp + 8)
- * mpi_size_t s1_size, (sp + 12)
- * mpi_limb_t s2_limb) (sp + 16)
- */
-
- /* i80386 addmul_1 -- Multiply a limb vector with a limb and add
- * the result to a second limb vector.
- *
- * Copyright (C) 1992, 1994, 1998,
- * 2001, 2002 Free Software Foundation, Inc.
- *
- * This file is part of Libgcrypt.
- *
- * Libgcrypt is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * Libgcrypt is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- *
- * Note: This code is heavily based on the GNU MP Library.
- * Actually it's the same code with only minor changes in the
- * way the data is stored; this is to support the abstraction
- * of an optional secure memory allocation which may be used
- * to avoid revealing of sensitive data due to paging etc.
- */
-
-
-#include "sysdep.h"
-#include "asm-syntax.h"
-
-
/*******************
* mpi_limb_t
* _gcry_mpih_addmul_1( mpi_ptr_t res_ptr, (rdi)
commit ed0a598172208ec67234a4edd73189bf6808fd04
Author: Jussi Kivilinna <jussi.kivilinna at iki.fi>
Date: Thu Jun 27 14:40:12 2013 +0300
Fix i386/amd64 inline assembly "cc" clobbers
* cipher/bithelp.h [__GNUC__, __i386__] (rol, ror): add "cc" globber
for inline assembly.
* cipher/cast5.c [__GNUC__, __i386__] (rol): Ditto.
* random/rndhw.c [USE_DRNG] (rdrand_long): Ditto.
* src/hmac256.c [__GNUC__, __i386__] (ror): Ditto.
* mpi/longlong.c [__i386__] (add_ssaaaa, sub_ddmmss, umul_ppmm)
(udiv_qrnnd, count_leading_zeros, count_trailing_zeros): Ditto.
--
These assembly snippets modify cflags but do not mark "cc" clobber.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
diff --git a/cipher/bithelp.h b/cipher/bithelp.h
index 1505324..785701e 100644
--- a/cipher/bithelp.h
+++ b/cipher/bithelp.h
@@ -30,7 +30,8 @@ rol( u32 x, int n)
{
__asm__("roll %%cl,%0"
:"=r" (x)
- :"0" (x),"c" (n));
+ :"0" (x),"c" (n)
+ :"cc");
return x;
}
#else
@@ -43,7 +44,8 @@ ror(u32 x, int n)
{
__asm__("rorl %%cl,%0"
:"=r" (x)
- :"0" (x),"c" (n));
+ :"0" (x),"c" (n)
+ :"cc");
return x;
}
#else
diff --git a/cipher/cast5.c b/cipher/cast5.c
index 41bc9ff..6017bf0 100644
--- a/cipher/cast5.c
+++ b/cipher/cast5.c
@@ -393,7 +393,8 @@ rol(int n, u32 x)
{
__asm__("roll %%cl,%0"
:"=r" (x)
- :"0" (x),"c" (n));
+ :"0" (x),"c" (n)
+ :"cc");
return x;
}
#else
diff --git a/mpi/longlong.h b/mpi/longlong.h
index 699b6b3..773d1c7 100644
--- a/mpi/longlong.h
+++ b/mpi/longlong.h
@@ -473,7 +473,8 @@ extern USItype __udiv_qrnnd ();
: "%0" ((USItype)(ah)), \
"g" ((USItype)(bh)), \
"%1" ((USItype)(al)), \
- "g" ((USItype)(bl)))
+ "g" ((USItype)(bl)) \
+ __CLOBBER_CC)
#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
__asm__ ("subl %5,%1\n" \
"sbbl %3,%0" \
@@ -482,29 +483,33 @@ extern USItype __udiv_qrnnd ();
: "0" ((USItype)(ah)), \
"g" ((USItype)(bh)), \
"1" ((USItype)(al)), \
- "g" ((USItype)(bl)))
+ "g" ((USItype)(bl)) \
+ __CLOBBER_CC)
#define umul_ppmm(w1, w0, u, v) \
__asm__ ("mull %3" \
: "=a" ((USItype)(w0)), \
"=d" ((USItype)(w1)) \
: "%0" ((USItype)(u)), \
- "rm" ((USItype)(v)))
+ "rm" ((USItype)(v)) \
+ __CLOBBER_CC)
#define udiv_qrnnd(q, r, n1, n0, d) \
__asm__ ("divl %4" \
: "=a" ((USItype)(q)), \
"=d" ((USItype)(r)) \
: "0" ((USItype)(n0)), \
"1" ((USItype)(n1)), \
- "rm" ((USItype)(d)))
+ "rm" ((USItype)(d)) \
+ __CLOBBER_CC)
#define count_leading_zeros(count, x) \
do { \
USItype __cbtmp; \
__asm__ ("bsrl %1,%0" \
- : "=r" (__cbtmp) : "rm" ((USItype)(x))); \
+ : "=r" (__cbtmp) : "rm" ((USItype)(x)) \
+ __CLOBBER_CC); \
(count) = __cbtmp ^ 31; \
} while (0)
#define count_trailing_zeros(count, x) \
- __asm__ ("bsfl %1,%0" : "=r" (count) : "rm" ((USItype)(x)))
+ __asm__ ("bsfl %1,%0" : "=r" (count) : "rm" ((USItype)(x)) __CLOBBER_CC)
#ifndef UMUL_TIME
#define UMUL_TIME 40
#endif
diff --git a/random/rndhw.c b/random/rndhw.c
index cbb28d1..ca99c5f 100644
--- a/random/rndhw.c
+++ b/random/rndhw.c
@@ -138,7 +138,8 @@ rdrand_long (unsigned long *v)
"jnz 1b\n\t"
"2:"
: "=r" (ok), "=a" (*v)
- : "0" (RDRAND_RETRY_LOOPS));
+ : "0" (RDRAND_RETRY_LOOPS)
+ : "cc");
return ok;
}
diff --git a/src/hmac256.c b/src/hmac256.c
index 34def76..2fda47b 100644
--- a/src/hmac256.c
+++ b/src/hmac256.c
@@ -104,7 +104,8 @@ ror(u32 x, int n)
{
__asm__("rorl %%cl,%0"
:"=r" (x)
- :"0" (x),"c" (n));
+ :"0" (x),"c" (n)
+ :"cc");
return x;
}
#else
commit c3902a6b5cea9acef2e15fbee24eb601eeb25168
Author: Jussi Kivilinna <jussi.kivilinna at iki.fi>
Date: Wed Jul 3 12:14:56 2013 +0300
bufhelp: Suppress 'cast increases required alignment' warning
* cipher/bufhelp.h (buf_xor, buf_xor_2dst, buf_xor_n_copy): Cast
to larger element pointer through (void *) to suppress -Wcast-error.
--
Patch disables bogus warnings caused by -Wcast-error. We know that byte
pointers are properly aligned at these phases, or that hardware can handle
unaligned accesses.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
diff --git a/cipher/bufhelp.h b/cipher/bufhelp.h
index 638ca1b..1c173e2 100644
--- a/cipher/bufhelp.h
+++ b/cipher/bufhelp.h
@@ -30,7 +30,7 @@
#if defined(__i386__) || defined(__x86_64__)
-/* These architechtures are able of unaligned memory accesses and can
+/* These architectures are able of unaligned memory accesses and can
handle those fast.
*/
# define BUFHELP_FAST_UNALIGNED_ACCESS 1
@@ -59,9 +59,9 @@ buf_xor(void *_dst, const void *_src1, const void *_src2, size_t len)
*dst++ = *src1++ ^ *src2++;
#endif
- ldst = (uintptr_t *)dst;
- lsrc1 = (const uintptr_t *)src1;
- lsrc2 = (const uintptr_t *)src2;
+ ldst = (uintptr_t *)(void *)dst;
+ lsrc1 = (const uintptr_t *)(const void *)src1;
+ lsrc2 = (const uintptr_t *)(const void *)src2;
for (; len >= sizeof(uintptr_t); len -= sizeof(uintptr_t))
*ldst++ = *lsrc1++ ^ *lsrc2++;
@@ -102,9 +102,9 @@ buf_xor_2dst(void *_dst1, void *_dst2, const void *_src, size_t len)
*dst1++ = (*dst2++ ^= *src++);
#endif
- ldst1 = (uintptr_t *)dst1;
- ldst2 = (uintptr_t *)dst2;
- lsrc = (const uintptr_t *)src;
+ ldst1 = (uintptr_t *)(void *)dst1;
+ ldst2 = (uintptr_t *)(void *)dst2;
+ lsrc = (const uintptr_t *)(const void *)src;
for (; len >= sizeof(uintptr_t); len -= sizeof(uintptr_t))
*ldst1++ = (*ldst2++ ^= *lsrc++);
@@ -151,9 +151,9 @@ buf_xor_n_copy(void *_dst_xor, void *_srcdst_cpy, const void *_src, size_t len)
}
#endif
- ldst_xor = (uintptr_t *)dst_xor;
- lsrcdst_cpy = (uintptr_t *)srcdst_cpy;
- lsrc = (const uintptr_t *)src;
+ ldst_xor = (uintptr_t *)(void *)dst_xor;
+ lsrcdst_cpy = (uintptr_t *)(void *)srcdst_cpy;
+ lsrc = (const uintptr_t *)(const void *)src;
for (; len >= sizeof(uintptr_t); len -= sizeof(uintptr_t))
{
commit 97f392f43cf2e4da1297cbecacbfbff33a869478
Author: Jussi Kivilinna <jussi.kivilinna at iki.fi>
Date: Wed Jul 3 11:32:25 2013 +0300
mpi: Add __ARM_ARCH for older GCC
* mpi/longlong.h [__arm__]: Construct __ARM_ARCH if not provided by
compiler.
--
GCC 4.8 defines __ARM_ARCH which provides forward compatible way to detect
ARM architecture. Use this when available and construct otherwise.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
diff --git a/mpi/longlong.h b/mpi/longlong.h
index 0f860af..699b6b3 100644
--- a/mpi/longlong.h
+++ b/mpi/longlong.h
@@ -186,6 +186,30 @@ extern UDItype __udiv_qrnnd ();
***************************************/
#if defined (__arm__) && W_TYPE_SIZE == 32 && \
(!defined (__thumb__) || defined (__thumb2__))
+/* The __ARM_ARCH define is provided by gcc 4.8. Construct it otherwise. */
+#ifndef __ARM_ARCH
+# ifdef __ARM_ARCH_2__
+# define __ARM_ARCH 2
+# elif defined (__ARM_ARCH_3__) || defined (__ARM_ARCH_3M__)
+# define __ARM_ARCH 3
+# elif defined (__ARM_ARCH_4__) || defined (__ARM_ARCH_4T__)
+# define __ARM_ARCH 4
+# elif defined (__ARM_ARCH_5__) || defined (__ARM_ARCH_5E__) \
+ || defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5TE__) \
+ || defined(__ARM_ARCH_5TEJ__)
+# define __ARM_ARCH 5
+# elif defined (__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
+ || defined (__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \
+ || defined (__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__)
+# define __ARM_ARCH 6
+# elif defined (__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
+ || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
+ || defined(__ARM_ARCH_7EM__)
+# define __ARM_ARCH 7
+# else
+ /* could not detect? */
+# endif
+#endif
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
__asm__ ("adds %1, %4, %5\n" \
"adc %0, %2, %3" \
@@ -204,9 +228,7 @@ extern UDItype __udiv_qrnnd ();
"rI" ((USItype)(bh)), \
"r" ((USItype)(al)), \
"rI" ((USItype)(bl)) __CLOBBER_CC)
-/* The __ARM_ARCH define is provided by gcc 4.8 */
-#if (defined __ARM_ARCH && __ARM_ARCH <= 3) || \
- defined __ARM_ARCH_2__ || defined __ARM_ARCH_3__
+#if (defined __ARM_ARCH && __ARM_ARCH <= 3)
#define umul_ppmm(xh, xl, a, b) \
__asm__ ("%@ Inlined umul_ppmm\n" \
"mov %|r0, %2, lsr #16 @ AAAA\n" \
@@ -238,10 +260,7 @@ extern UDItype __udiv_qrnnd ();
#endif /* __ARM_ARCH >= 4 */
#define UMUL_TIME 20
#define UDIV_TIME 100
-/* The __ARM_ARCH define is provided by gcc 4.8 */
-#if (defined __ARM_ARCH && __ARM_ARCH >= 5) || !(defined __ARM_ARCH_2__ || \
- defined __ARM_ARCH_3__ || defined __ARM_ARCH_3M__ || __ARM_ARCH_4__ || \
- __ARM_ARCH_4T__)
+#if (defined __ARM_ARCH && __ARM_ARCH >= 5)
#define count_leading_zeros(count, x) \
__asm__ ("clz %0, %1" \
: "=r" ((USItype)(count)) \
commit 8aa4f2161cf643ce36d87d2e2786b546736f8232
Author: Jussi Kivilinna <jussi.kivilinna at iki.fi>
Date: Wed Jul 3 15:10:11 2013 +0300
mpi: add missing "cc" clobber for ARM assembly
* mpi/longlong.h [__arm__] (add_ssaaaa, sub_ddmmss): Add __CLOBBER_CC.
[__arm__][__ARM_ARCH <= 3] (umul_ppmm): Ditto.
--
Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
diff --git a/mpi/longlong.h b/mpi/longlong.h
index bb34fd7..0f860af 100644
--- a/mpi/longlong.h
+++ b/mpi/longlong.h
@@ -194,7 +194,7 @@ extern UDItype __udiv_qrnnd ();
: "%r" ((USItype)(ah)), \
"rI" ((USItype)(bh)), \
"%r" ((USItype)(al)), \
- "rI" ((USItype)(bl)))
+ "rI" ((USItype)(bl)) __CLOBBER_CC)
#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
__asm__ ("subs %1, %4, %5\n" \
"sbc %0, %2, %3" \
@@ -203,7 +203,7 @@ extern UDItype __udiv_qrnnd ();
: "r" ((USItype)(ah)), \
"rI" ((USItype)(bh)), \
"r" ((USItype)(al)), \
- "rI" ((USItype)(bl)))
+ "rI" ((USItype)(bl)) __CLOBBER_CC)
/* The __ARM_ARCH define is provided by gcc 4.8 */
#if (defined __ARM_ARCH && __ARM_ARCH <= 3) || \
defined __ARM_ARCH_2__ || defined __ARM_ARCH_3__
@@ -225,7 +225,7 @@ extern UDItype __udiv_qrnnd ();
"=r" ((USItype)(xl)) \
: "r" ((USItype)(a)), \
"r" ((USItype)(b)) \
- : "r0", "r1", "r2")
+ : "r0", "r1", "r2" __CLOBBER_CC)
#else /* __ARM_ARCH >= 4 */
#define umul_ppmm(xh, xl, a, b) \
__asm__ ("%@ Inlined umul_ppmm\n" \
commit 71dda4507053379433dc8b0fc6462c15de7299df
Author: Jussi Kivilinna <jussi.kivilinna at iki.fi>
Date: Wed Jul 3 11:14:56 2013 +0300
Tweak ARM inline assembly for mpi
mpi/longlong.h [__arm__]: Enable inline assembly if __thumb2__ is
defined.
[__arm__]: Use __ARCH_ARM when defined.
[__arm__] [__ARM_ARCH >= 5] (count_leading_zeros): New.
--
Current ARM Linux distributions use EABI that enables thumb2, and therefore
inline assembly is disable (because !defined(__thumb__) selector). However
thumb2 allows the use of assembly instructions that longlong.h contains for
ARM. So this patch enables inline assembly for ARM when __thumb2__ is defined
in addition to __thumb__.
Patch also adds optimization for count_leading_zeros() macro for ARM.
Results on Cortex-A8, 1Ghz:
===
Before:
Algorithm generate 100*sign 100*verify
------------------------------------------------
RSA 1024 bit 750ms 2780ms 110ms
RSA 2048 bit 14280ms 17250ms 300ms
RSA 3072 bit 38630ms 51300ms 650ms
RSA 4096 bit 60940ms 111430ms 1000ms
jussi at cubie:~/libgcrypt$ tests/benchmark dsa
Algorithm generate 100*sign 100*verify
------------------------------------------------
DSA 1024/160 - 1410ms 1680ms
DSA 2048/224 - 6100ms 7390ms
DSA 3072/256 - 14350ms 17120ms
jussi at cubie:~/libgcrypt$ tests/benchmark ecc
Algorithm generate 100*sign 100*verify
------------------------------------------------
ECDSA 192 bit 90ms 2160ms 3940ms
ECDSA 224 bit 110ms 2810ms 5400ms
ECDSA 256 bit 150ms 3570ms 6970ms
ECDSA 384 bit 340ms 8320ms 16420ms
ECDSA 521 bit 850ms 19760ms 38480ms
After:
jussi at cubie:~/libgcrypt$ tests/benchmark rsa
Algorithm generate 100*sign 100*verify
------------------------------------------------
RSA 1024 bit 590ms 2230ms 80ms
RSA 2048 bit 2320ms 13090ms 240ms
RSA 3072 bit 60580ms 38420ms 460ms
RSA 4096 bit 115130ms 82250ms 750ms
jussi at cubie:~/libgcrypt$ tests/benchmark dsa
Algorithm generate 100*sign 100*verify
------------------------------------------------
DSA 1024/160 - 1070ms 1290ms
DSA 2048/224 - 4500ms 5550ms
DSA 3072/256 - 10280ms 12200ms
jussi at cubie:~/libgcrypt$ tests/benchmark ecc
Algorithm generate 100*sign 100*verify
------------------------------------------------
ECDSA 192 bit 70ms 1900ms 3560ms
ECDSA 224 bit 100ms 2490ms 4750ms
ECDSA 256 bit 120ms 3140ms 5920ms
ECDSA 384 bit 270ms 6990ms 13790ms
ECDSA 521 bit 680ms 17080ms 33490ms
Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
diff --git a/mpi/longlong.h b/mpi/longlong.h
index 5dba793..bb34fd7 100644
--- a/mpi/longlong.h
+++ b/mpi/longlong.h
@@ -184,7 +184,8 @@ extern UDItype __udiv_qrnnd ();
/***************************************
************** ARM ******************
***************************************/
-#if defined (__arm__) && W_TYPE_SIZE == 32 && !defined (__thumb__)
+#if defined (__arm__) && W_TYPE_SIZE == 32 && \
+ (!defined (__thumb__) || defined (__thumb2__))
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
__asm__ ("adds %1, %4, %5\n" \
"adc %0, %2, %3" \
@@ -203,7 +204,9 @@ extern UDItype __udiv_qrnnd ();
"rI" ((USItype)(bh)), \
"r" ((USItype)(al)), \
"rI" ((USItype)(bl)))
-#if defined __ARM_ARCH_2__ || defined __ARM_ARCH_3__
+/* The __ARM_ARCH define is provided by gcc 4.8 */
+#if (defined __ARM_ARCH && __ARM_ARCH <= 3) || \
+ defined __ARM_ARCH_2__ || defined __ARM_ARCH_3__
#define umul_ppmm(xh, xl, a, b) \
__asm__ ("%@ Inlined umul_ppmm\n" \
"mov %|r0, %2, lsr #16 @ AAAA\n" \
@@ -223,7 +226,7 @@ extern UDItype __udiv_qrnnd ();
: "r" ((USItype)(a)), \
"r" ((USItype)(b)) \
: "r0", "r1", "r2")
-#else
+#else /* __ARM_ARCH >= 4 */
#define umul_ppmm(xh, xl, a, b) \
__asm__ ("%@ Inlined umul_ppmm\n" \
"umull %r1, %r0, %r2, %r3" \
@@ -232,9 +235,18 @@ extern UDItype __udiv_qrnnd ();
: "r" ((USItype)(a)), \
"r" ((USItype)(b)) \
: "r0", "r1")
-#endif
+#endif /* __ARM_ARCH >= 4 */
#define UMUL_TIME 20
#define UDIV_TIME 100
+/* The __ARM_ARCH define is provided by gcc 4.8 */
+#if (defined __ARM_ARCH && __ARM_ARCH >= 5) || !(defined __ARM_ARCH_2__ || \
+ defined __ARM_ARCH_3__ || defined __ARM_ARCH_3M__ || __ARM_ARCH_4__ || \
+ __ARM_ARCH_4T__)
+#define count_leading_zeros(count, x) \
+ __asm__ ("clz %0, %1" \
+ : "=r" ((USItype)(count)) \
+ : "r" ((USItype)(x)))
+#endif /* __ARM_ARCH >= 5 */
#endif /* __arm__ */
/***************************************
-----------------------------------------------------------------------
Summary of changes:
cipher/bithelp.h | 6 +++-
cipher/bufhelp.h | 20 ++++++++--------
cipher/cast5.c | 3 +-
mpi/amd64/mpih-mul2.S | 43 ----------------------------------
mpi/longlong.h | 62 ++++++++++++++++++++++++++++++++++++++----------
random/rndhw.c | 3 +-
random/rndw32.c | 1 +
src/ath.h | 1 +
src/hmac256.c | 3 +-
tests/benchmark.c | 1 +
10 files changed, 72 insertions(+), 71 deletions(-)
hooks/post-receive
--
The GNU crypto library
http://git.gnupg.org
More information about the Gnupg-commits
mailing list