[git] GCRYPT - branch, master, updated. libgcrypt-1.5.0-67-g6765e0a

by Werner Koch cvs at cvs.gnupg.org
Wed Nov 28 11:11:18 CET 2012


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  6765e0a8618000d3dc7bda035163e0708c43791b (commit)
       via  99e272d938fe23efec25af409bdb91dae0e659e5 (commit)
      from  faec12e23f03c7cd1614594bfdd51f1302cadb42 (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 6765e0a8618000d3dc7bda035163e0708c43791b
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Nov 28 09:40:57 2012 +0100

    Make a cpp conditional in rijndael.c better readable.
    
    * cipher/rijndael.c (USE_AESNI): Modify cpp conditionals for better
    readability.

diff --git a/cipher/rijndael.c b/cipher/rijndael.c
index 0f5e07c..cc7f8d6 100644
--- a/cipher/rijndael.c
+++ b/cipher/rijndael.c
@@ -1,6 +1,6 @@
 /* Rijndael (AES) for GnuPG
  * Copyright (C) 2000, 2001, 2002, 2003, 2007,
- *               2008, 2011 Free Software Foundation, Inc.
+ *               2008, 2011, 2012 Free Software Foundation, Inc.
  *
  * This file is part of Libgcrypt.
  *
@@ -75,8 +75,10 @@
    gcc 3.  However, to be on the safe side we require at least gcc 4.  */
 #undef USE_AESNI
 #ifdef ENABLE_AESNI_SUPPORT
-# if ((defined (__i386__) && SIZEOF_UNSIGNED_LONG == 4) || defined(__x86_64__)) && __GNUC__ >= 4
-#  define USE_AESNI 1
+# if ((defined (__i386__) && SIZEOF_UNSIGNED_LONG == 4) || defined(__x86_64__))
+#  if __GNUC__ >= 4
+#   define USE_AESNI 1
+#  endif
 # endif
 #endif /* ENABLE_AESNI_SUPPORT */
 

commit 99e272d938fe23efec25af409bdb91dae0e659e5
Author: Jussi Kivilinna <jussi.kivilinna at mbnet.fi>
Date:   Tue Nov 27 23:44:13 2012 +0200

    Fix building with Clang on x86-64 and i386
    
    * cipher/rijndael.c [USE_AESNI] (do_aesni_enc_aligned)
    (do_aesni_dec_vec4, do_aesni_cfb, do_aesni_ctr, do_aesni_ctr_4): Add
    explicit suffix to 'cmp' instructions.
    --
    
    Clang throws errors on missing instruction suffixes, such as:
    
    rijndael.c:1091:39: error: ambiguous instructions require an explicit suffix (could be 'cmpb', 'cmpw', 'cmpl', or 'cmpq')
    <inline asm>:39:2: note: instantiated into assembly here
            cmp $1, -44(%rbp)
    
    With this patch building on x86-64 works fine. Other issues still exists on i386,
    namely with MPI, which can be overcome with 'clang -fheinous-gnu-extensions'.
    
    [v2]:
     - remove do_aesni_enc_vec4 modification as that function didn't make it to upstream.
    
    Signed-off-by: Jussi Kivilinna <jussi.kivilinna at mbnet.fi>
    
    NB: I still believe it is a bad idea of clang to define __GNUC__
    and not being 100% compatible to gcc. [wk]

diff --git a/cipher/rijndael.c b/cipher/rijndael.c
index 860dcf8..0f5e07c 100644
--- a/cipher/rijndael.c
+++ b/cipher/rijndael.c
@@ -742,13 +742,13 @@ do_aesni_enc_aligned (const RIJNDAEL_context *ctx,
                 "movdqa 0x90(%[key]), %%xmm1\n\t"
                 aesenc_xmm1_xmm0
                 "movdqa 0xa0(%[key]), %%xmm1\n\t"
-                "cmp $10, %[rounds]\n\t"
+                "cmpl $10, %[rounds]\n\t"
                 "jz .Lenclast%=\n\t"
                 aesenc_xmm1_xmm0
                 "movdqa 0xb0(%[key]), %%xmm1\n\t"
                 aesenc_xmm1_xmm0
                 "movdqa 0xc0(%[key]), %%xmm1\n\t"
-                "cmp $12, %[rounds]\n\t"
+                "cmpl $12, %[rounds]\n\t"
                 "jz .Lenclast%=\n\t"
                 aesenc_xmm1_xmm0
                 "movdqa 0xd0(%[key]), %%xmm1\n\t"
@@ -796,13 +796,13 @@ do_aesni_dec_aligned (const RIJNDAEL_context *ctx,
                 "movdqa 0x90(%[key]), %%xmm1\n\t"
                 aesdec_xmm1_xmm0
                 "movdqa 0xa0(%[key]), %%xmm1\n\t"
-                "cmp $10, %[rounds]\n\t"
+                "cmpl $10, %[rounds]\n\t"
                 "jz .Ldeclast%=\n\t"
                 aesdec_xmm1_xmm0
                 "movdqa 0xb0(%[key]), %%xmm1\n\t"
                 aesdec_xmm1_xmm0
                 "movdqa 0xc0(%[key]), %%xmm1\n\t"
-                "cmp $12, %[rounds]\n\t"
+                "cmpl $12, %[rounds]\n\t"
                 "jz .Ldeclast%=\n\t"
                 aesdec_xmm1_xmm0
                 "movdqa 0xd0(%[key]), %%xmm1\n\t"
@@ -886,7 +886,7 @@ do_aesni_dec_vec4 (const RIJNDAEL_context *ctx)
                 aesdec_xmm0_xmm3
                 aesdec_xmm0_xmm4
                 "movdqa 0xa0(%[key]), %%xmm0\n\t"
-                "cmp $10, %[rounds]\n\t"
+                "cmpl $10, %[rounds]\n\t"
                 "jz .Ldeclast%=\n\t"
                 aesdec_xmm0_xmm1
                 aesdec_xmm0_xmm2
@@ -898,7 +898,7 @@ do_aesni_dec_vec4 (const RIJNDAEL_context *ctx)
                 aesdec_xmm0_xmm3
                 aesdec_xmm0_xmm4
                 "movdqa 0xc0(%[key]), %%xmm0\n\t"
-                "cmp $12, %[rounds]\n\t"
+                "cmpl $12, %[rounds]\n\t"
                 "jz .Ldeclast%=\n\t"
                 aesdec_xmm0_xmm1
                 aesdec_xmm0_xmm2
@@ -963,13 +963,13 @@ do_aesni_cfb (const RIJNDAEL_context *ctx, int decrypt_flag,
                 "movdqa 0x90(%[key]), %%xmm1\n\t"
                 aesenc_xmm1_xmm0
                 "movdqa 0xa0(%[key]), %%xmm1\n\t"
-                "cmp $10, %[rounds]\n\t"
+                "cmpl $10, %[rounds]\n\t"
                 "jz .Lenclast%=\n\t"
                 aesenc_xmm1_xmm0
                 "movdqa 0xb0(%[key]), %%xmm1\n\t"
                 aesenc_xmm1_xmm0
                 "movdqa 0xc0(%[key]), %%xmm1\n\t"
-                "cmp $12, %[rounds]\n\t"
+                "cmpl $12, %[rounds]\n\t"
                 "jz .Lenclast%=\n\t"
                 aesenc_xmm1_xmm0
                 "movdqa 0xd0(%[key]), %%xmm1\n\t"
@@ -981,7 +981,7 @@ do_aesni_cfb (const RIJNDAEL_context *ctx, int decrypt_flag,
                 "movdqu %[src], %%xmm1\n\t"      /* Save input.  */
                 "pxor %%xmm1, %%xmm0\n\t"        /* xmm0 = input ^ IV  */
 
-                "cmp $1, %[decrypt]\n\t"
+                "cmpl $1, %[decrypt]\n\t"
                 "jz .Ldecrypt_%=\n\t"
                 "movdqa %%xmm0, %[iv]\n\t"       /* [encrypt] Store IV.  */
                 "jmp .Lleave_%=\n"
@@ -1058,13 +1058,13 @@ do_aesni_ctr (const RIJNDAEL_context *ctx,
                 "movdqa 0x90(%[key]), %%xmm1\n\t"
                 aesenc_xmm1_xmm0
                 "movdqa 0xa0(%[key]), %%xmm1\n\t"
-                "cmp $10, %[rounds]\n\t"
+                "cmpl $10, %[rounds]\n\t"
                 "jz .Lenclast%=\n\t"
                 aesenc_xmm1_xmm0
                 "movdqa 0xb0(%[key]), %%xmm1\n\t"
                 aesenc_xmm1_xmm0
                 "movdqa 0xc0(%[key]), %%xmm1\n\t"
-                "cmp $12, %[rounds]\n\t"
+                "cmpl $12, %[rounds]\n\t"
                 "jz .Lenclast%=\n\t"
                 aesenc_xmm1_xmm0
                 "movdqa 0xd0(%[key]), %%xmm1\n\t"
@@ -1219,7 +1219,7 @@ do_aesni_ctr_4 (const RIJNDAEL_context *ctx,
                 aesenc_xmm1_xmm3
                 aesenc_xmm1_xmm4
                 "movdqa 0xa0(%[key]), %%xmm1\n\t"
-                "cmp $10, %[rounds]\n\t"
+                "cmpl $10, %[rounds]\n\t"
                 "jz .Lenclast%=\n\t"
                 aesenc_xmm1_xmm0
                 aesenc_xmm1_xmm2
@@ -1231,7 +1231,7 @@ do_aesni_ctr_4 (const RIJNDAEL_context *ctx,
                 aesenc_xmm1_xmm3
                 aesenc_xmm1_xmm4
                 "movdqa 0xc0(%[key]), %%xmm1\n\t"
-                "cmp $12, %[rounds]\n\t"
+                "cmpl $12, %[rounds]\n\t"
                 "jz .Lenclast%=\n\t"
                 aesenc_xmm1_xmm0
                 aesenc_xmm1_xmm2

-----------------------------------------------------------------------

Summary of changes:
 cipher/rijndael.c |   34 ++++++++++++++++++----------------
 1 files changed, 18 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
The GNU crypto library
http://git.gnupg.org




More information about the Gnupg-commits mailing list