]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Use nettle's memxor or gnulib's if it doesn't exist.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 1 Jun 2011 12:36:44 +0000 (14:36 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 1 Jun 2011 12:36:44 +0000 (14:36 +0200)
lib/accelerated/intel/aes-gcm-x86.c
lib/gnutls_int.h
lib/gnutls_state.c

index 74de3aad93ae0a4f1976cf73d607c66b242332b6..e5668db3985be9cbe102c316636c450225b7a2e2 100644 (file)
@@ -32,7 +32,6 @@
 #include <aes-x86.h>
 #include <x86.h>
 #include <byteswap.h>
-#include <nettle/memxor.h>
 
 #define GCM_BLOCK_SIZE 16
 
index 104492a578296001cf270e7e93e460bd4eff591b..a352055214ff8a7ab058d3d3221bab1b8acf3649 100644 (file)
@@ -50,6 +50,13 @@ typedef int ssize_t;
 #include <time.h>
 #include <u64.h> /* gnulib for uint64_t */
 
+#ifdef HAVE_LIBNETTLE
+# include <nettle/memxor.h>
+#else
+# include <gl/memxor.h>
+# define gl_memxor memxor
+#endif
+
 /* some systems had problems with long long int, thus,
  * it is not used.
  */
index 93a38b1b2c53d8311b0c41ca5d7a7612c77473e5..859ed146ea380297a2f23cb73dff8c6fddb19173 100644 (file)
@@ -891,20 +891,6 @@ _gnutls_P_hash (gnutls_mac_algorithm_t algorithm,
   return 0;
 }
 
-/* Xor's two buffers and puts the output in the first one.
- */
-inline static void
-_gnutls_xor (opaque * o1, opaque * o2, int length)
-{
-  int i;
-  for (i = 0; i < length; i++)
-    {
-      o1[i] ^= o2[i];
-    }
-}
-
-
-
 #define MAX_PRF_BYTES 200
 
 /* The PRF function expands a given secret 
@@ -982,7 +968,7 @@ _gnutls_PRF (gnutls_session_t session,
           return result;
         }
 
-      _gnutls_xor (o1, o2, total_bytes);
+      memxor (o1, o2, total_bytes);
 
       memcpy (ret, o1, total_bytes);
     }