gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, master, updated. gnutls_3_0_15-22-gcdcb458


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_3_0_15-22-gcdcb458
Date: Wed, 07 Mar 2012 22:29:48 +0000

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 "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=cdcb458991053a9a972ddf2f9e2cd3fca3c96dd6

The branch, master has been updated
       via  cdcb458991053a9a972ddf2f9e2cd3fca3c96dd6 (commit)
       via  1393e95e3f5534b84fa016fdd1992b1e381a18bf (commit)
       via  407e88dbfbf9b2215d79588626c00f935d41d50a (commit)
       via  1c30249626109a32c8be144d2dd577f77c5bccaf (commit)
      from  06a51074653a7bf7245d484a62152d2fa160b5f6 (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 cdcb458991053a9a972ddf2f9e2cd3fca3c96dd6
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Wed Mar 7 23:34:50 2012 +0100

    when using cryptodev do not set all the digest function since they are not 
always faster.

commit 1393e95e3f5534b84fa016fdd1992b1e381a18bf
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Wed Mar 7 23:05:47 2012 +0100

    corrected comments.

commit 407e88dbfbf9b2215d79588626c00f935d41d50a
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Wed Mar 7 22:30:40 2012 +0100

    reset the siop structure on every loop

commit 1c30249626109a32c8be144d2dd577f77c5bccaf
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Wed Mar 7 22:20:48 2012 +0100

    add more space to dst to allow GCM mode tests in cryptodev.

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

Summary of changes:
 lib/accelerated/cryptodev.c           |  159 ++++-----------------------------
 lib/accelerated/x86/aes-gcm-padlock.c |    4 +-
 lib/accelerated/x86/aes-gcm-x86.c     |    5 +-
 src/benchmark-cipher.c                |    4 +-
 4 files changed, 22 insertions(+), 150 deletions(-)

diff --git a/lib/accelerated/cryptodev.c b/lib/accelerated/cryptodev.c
index 6d8dd86..7d1eacc 100644
--- a/lib/accelerated/cryptodev.c
+++ b/lib/accelerated/cryptodev.c
@@ -182,8 +182,6 @@ register_crypto (int cfd)
   int ret;
 #ifdef CIOCGSESSINFO
   struct session_info_op siop;
-
-  memset(&siop, 0, sizeof(siop));
 #endif
 
   memset (&sess, 0, sizeof (sess));
@@ -205,6 +203,8 @@ register_crypto (int cfd)
         }
 
 #ifdef CIOCGSESSINFO
+      memset(&siop, 0, sizeof(siop));
+
       siop.ses = sess.ses; /* do not register ciphers that are not hw 
accelerated */
       if (ioctl(cfd, CIOCGSESSINFO, &siop) == 0) 
         {
@@ -312,98 +312,6 @@ static const int gnutls_mac_map[] = {
 };
 
 static int
-cryptodev_mac_init (gnutls_mac_algorithm_t algorithm, void **_ctx)
-{
-  struct cryptodev_ctx *ctx;
-  int mac = gnutls_mac_map[algorithm];
-
-  *_ctx = gnutls_calloc (1, sizeof (struct cryptodev_ctx));
-  if (*_ctx == NULL)
-    {
-      gnutls_assert ();
-      return GNUTLS_E_MEMORY_ERROR;
-    }
-
-  ctx = *_ctx;
-
-  ctx->cfd = _gnutls_cryptodev_fd;
-
-  ctx->sess.mac = mac;
-
-  return 0;
-}
-
-static int
-cryptodev_mac_setkey (void *_ctx, const void *key, size_t keysize)
-{
-  struct cryptodev_ctx *ctx = _ctx;
-
-  ctx->sess.mackeylen = keysize;
-  ctx->sess.mackey = (void*)key;
-
-  if (ioctl (ctx->cfd, CIOCGSESSION, &ctx->sess))
-    {
-      gnutls_assert ();
-      return GNUTLS_E_CRYPTODEV_IOCTL_ERROR;
-    }
-  ctx->cryp.ses = ctx->sess.ses;
-
-  return 0;
-}
-
-static int
-cryptodev_mac_hash (void *_ctx, const void *text, size_t textsize)
-{
-  struct cryptodev_ctx *ctx = _ctx;
-
-  ctx->cryp.len = textsize;
-  ctx->cryp.src = (void *) text;
-  ctx->cryp.dst = NULL;
-  ctx->cryp.op = COP_ENCRYPT;
-  ctx->cryp.flags = COP_FLAG_UPDATE;
-  if (ctx->reset)
-    {
-      ctx->cryp.flags |= COP_FLAG_RESET;
-      ctx->reset = 0;
-    }
-  
-  if (ioctl (ctx->cfd, CIOCCRYPT, &ctx->cryp))
-    {
-      gnutls_assert ();
-      return GNUTLS_E_CRYPTODEV_IOCTL_ERROR;
-    }
-  return 0;
-}
-
-static int
-cryptodev_mac_output (void *_ctx, void *digest, size_t digestsize)
-{
-  struct cryptodev_ctx *ctx = _ctx;
-
-  ctx->cryp.len = 0;
-  ctx->cryp.src = NULL;
-  ctx->cryp.mac = digest;
-  ctx->cryp.op = COP_ENCRYPT;
-  ctx->cryp.flags = COP_FLAG_FINAL;
-
-  if (ioctl (ctx->cfd, CIOCCRYPT, &ctx->cryp))
-    {
-      gnutls_assert ();
-      return GNUTLS_E_CRYPTODEV_IOCTL_ERROR;
-    }
-
-  return 0;
-}
-
-static void
-cryptodev_mac_reset (void *_ctx)
-{
-  struct cryptodev_ctx *ctx = _ctx;
-
-  ctx->reset = 1;
-}
-
-static int
 cryptodev_mac_fast (gnutls_mac_algorithm_t algo,
                     const void *key, size_t key_size, const void *text,
                     size_t text_size, void *digest)
@@ -441,12 +349,12 @@ int ret;
 #define cryptodev_mac_deinit cryptodev_deinit
 
 static const gnutls_crypto_mac_st mac_struct = {
-  .init = cryptodev_mac_init,
-  .setkey = cryptodev_mac_setkey,
-  .hash = cryptodev_mac_hash,
-  .output = cryptodev_mac_output,
-  .deinit = cryptodev_mac_deinit,
-  .reset = cryptodev_mac_reset,
+  .init = NULL,
+  .setkey = NULL,
+  .hash = NULL,
+  .output = NULL,
+  .deinit = NULL,
+  .reset = NULL,
   .fast = cryptodev_mac_fast
 };
 
@@ -461,39 +369,6 @@ static const int gnutls_digest_map[] = {
 };
 
 static int
-cryptodev_digest_init (gnutls_digest_algorithm_t algorithm, void **_ctx)
-{
-  struct cryptodev_ctx *ctx;
-  int dig = gnutls_digest_map[algorithm];
-
-  *_ctx = gnutls_calloc (1, sizeof (struct cryptodev_ctx));
-  if (*_ctx == NULL)
-    {
-      gnutls_assert ();
-      return GNUTLS_E_MEMORY_ERROR;
-    }
-
-  ctx = *_ctx;
-
-  ctx->cfd = _gnutls_cryptodev_fd;
-  ctx->sess.mac = dig;
-
-  if (ioctl (ctx->cfd, CIOCGSESSION, &ctx->sess))
-    {
-      gnutls_assert ();
-      gnutls_free(ctx);
-      return GNUTLS_E_CRYPTODEV_IOCTL_ERROR;
-    }
-  ctx->cryp.ses = ctx->sess.ses;
-
-  return 0;
-}
-
-#define cryptodev_digest_hash cryptodev_mac_hash
-#define cryptodev_digest_output cryptodev_mac_output
-#define cryptodev_digest_reset cryptodev_mac_reset
-
-static int
 cryptodev_digest_fast (gnutls_digest_algorithm_t algo,
                        const void *text, size_t text_size, 
                        void *digest)
@@ -525,14 +400,12 @@ int ret;
   return 0;
 }
 
-#define cryptodev_digest_deinit cryptodev_deinit
-
 static const gnutls_crypto_digest_st digest_struct = {
-  .init = cryptodev_digest_init,
-  .hash = cryptodev_digest_hash,
-  .output = cryptodev_digest_output,
-  .deinit = cryptodev_digest_deinit,
-  .reset = cryptodev_digest_reset,
+  .init = NULL,
+  .hash = NULL,
+  .output = NULL,
+  .deinit = NULL,
+  .reset = NULL,
   .fast = cryptodev_digest_fast
 };
 
@@ -545,8 +418,6 @@ register_mac_digest (int cfd)
   int ret;
 #ifdef CIOCGSESSINFO
   struct session_info_op siop;
-
-  memset(&siop, 0, sizeof(siop));
 #endif
 
   memset (&sess, 0, sizeof (sess));
@@ -565,6 +436,8 @@ register_mac_digest (int cfd)
         }
 
 #ifdef CIOCGSESSINFO
+      memset(&siop, 0, sizeof(siop));
+
       siop.ses = sess.ses; /* do not register ciphers that are not hw 
accelerated */
       if (ioctl(cfd, CIOCGSESSINFO, &siop) == 0) 
         {
@@ -602,6 +475,8 @@ register_mac_digest (int cfd)
         }
 
 #ifdef CIOCGSESSINFO
+      memset(&siop, 0, sizeof(siop));
+
       siop.ses = sess.ses;
       if (ioctl(cfd, CIOCGSESSINFO, &siop) == 0) 
         {
diff --git a/lib/accelerated/x86/aes-gcm-padlock.c 
b/lib/accelerated/x86/aes-gcm-padlock.c
index 5c17a2b..0fe9974 100644
--- a/lib/accelerated/x86/aes-gcm-padlock.c
+++ b/lib/accelerated/x86/aes-gcm-padlock.c
@@ -21,9 +21,7 @@
  */
 
 /*
- * The following code is an implementation of the AES-128-CBC cipher
- * using intel's AES instruction set. It is based on Intel reference
- * code.
+ * The following code is an implementation of the AES-128-GCM cipher
  */
 
 #include <gnutls_errors.h>
diff --git a/lib/accelerated/x86/aes-gcm-x86.c 
b/lib/accelerated/x86/aes-gcm-x86.c
index 29339fd..d4f401f 100644
--- a/lib/accelerated/x86/aes-gcm-x86.c
+++ b/lib/accelerated/x86/aes-gcm-x86.c
@@ -21,9 +21,8 @@
  */
 
 /*
- * The following code is an implementation of the AES-128-CBC cipher
- * using intel's AES instruction set. It is based on Intel reference
- * code.
+ * The following code is an implementation of the AES-128-GCM cipher
+ * using intel's AES instruction set.
  */
 
 #include <gnutls_errors.h>
diff --git a/src/benchmark-cipher.c b/src/benchmark-cipher.c
index e15211f..c069515 100644
--- a/src/benchmark-cipher.c
+++ b/src/benchmark-cipher.c
@@ -94,7 +94,7 @@ cipher_mac_bench (int algo, int mac_algo, int size)
   do
     {
       gnutls_hmac(mac_ctx, data, step);
-      gnutls_cipher_encrypt (ctx, data, step);
+      gnutls_cipher_encrypt2 (ctx, data, step, data, step+64);
       st.size += step;
     }
   while (benchmark_must_finish == 0);
@@ -158,7 +158,7 @@ cipher_bench (int algo, int size, int aead)
 
   do
     {
-      gnutls_cipher_encrypt (ctx, data, step);
+      gnutls_cipher_encrypt2 (ctx, data, step, data, step+64);
       st.size += step;
     }
   while (benchmark_must_finish == 0);


hooks/post-receive
-- 
GNU gnutls



reply via email to

[Prev in Thread] Current Thread [Next in Thread]