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_3-45-g59c61c7


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_3_0_3-45-g59c61c7
Date: Sat, 01 Oct 2011 17:40:18 +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=59c61c7a724637706a3f578e01994adbff40c919

The branch, master has been updated
       via  59c61c7a724637706a3f578e01994adbff40c919 (commit)
       via  a7a794ad486f41cd848afc4dfe1b20371decbdef (commit)
      from  f402f9b2d2358c2a09e8973fcf877c7de71cd308 (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 59c61c7a724637706a3f578e01994adbff40c919
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sat Oct 1 19:40:35 2011 +0200

    documented updates

commit a7a794ad486f41cd848afc4dfe1b20371decbdef
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sat Oct 1 13:28:09 2011 +0200

    optimizations in hmac.

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

Summary of changes:
 NEWS             |    9 +++++++++
 lib/nettle/mac.c |   40 +++++++++++++++++-----------------------
 2 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/NEWS b/NEWS
index 29502cd..49caf02 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,15 @@ See the end for copying conditions.
 
 * Version 3.0.4 (unreleased)
 
+** gnutls-cli: Added --benchmark-soft-ciphers to benchmark
+the software version of the ciphers instead of hw accelerated 
+(where available)
+
+** libgnutls: Corrected VIA padlock code for C3. Benchmarks show
+a 50% increase in AES speed.
+
+** libgnutls: Compilation fixed when p11-kit is not detected.
+
 ** libgnutls: Fixed the deflate compression code.
 
 ** libgnutls: Added gnutls_x509_crt_get_authority_info_access.
diff --git a/lib/nettle/mac.c b/lib/nettle/mac.c
index 36cded6..a84c1ce 100644
--- a/lib/nettle/mac.c
+++ b/lib/nettle/mac.c
@@ -50,7 +50,7 @@ struct nettle_hash_ctx
     struct sha1_ctx sha1;
   } ctx;
   void *ctx_ptr;
-  gnutls_mac_algorithm_t algo;
+  gnutls_digest_algorithm_t algo;
   size_t length;
   update_func update;
   digest_func digest;
@@ -67,20 +67,25 @@ struct nettle_hmac_ctx
     struct hmac_sha512_ctx sha512;
     struct hmac_sha1_ctx sha1;
   } ctx;
+  
+  /* this is the context just after
+   * the set_key. Used in reset().
+   */
+  union
+  {
+    struct hmac_md5_ctx md5;
+    struct hmac_sha224_ctx sha224;
+    struct hmac_sha256_ctx sha256;
+    struct hmac_sha384_ctx sha384;
+    struct hmac_sha512_ctx sha512;
+    struct hmac_sha1_ctx sha1;
+  } init_ctx;
   void *ctx_ptr;
   gnutls_mac_algorithm_t algo;
   size_t length;
   update_func update;
   digest_func digest;
   set_key_func setkey;
-
-/* Note: Nettle doesn't have a reset function for
- * hmac so we need to manually reset a context, by
- * calling set_key(). For that reason we need to
- * store the hmac key here.
- */
-  opaque *key;
-  size_t key_size;
 };
 
 static int _hmac_ctx_init(gnutls_mac_algorithm_t algo, struct nettle_hmac_ctx 
*ctx)
@@ -184,17 +189,9 @@ wrap_nettle_hmac_setkey (void *_ctx, const void *key, 
size_t keylen)
 {
   struct nettle_hmac_ctx *ctx = _ctx;
 
-  if (ctx->key)
-    gnutls_free(ctx->key);
-
-  ctx->key = gnutls_malloc(keylen);
-  if (ctx->key == NULL)
-    return gnutls_assert_val(GNUTLS_E_MEMORY_ERROR);
-
-  memcpy(ctx->key, key, keylen);
-  ctx->key_size = keylen;
-
   ctx->setkey (ctx->ctx_ptr, keylen, key);
+  
+  memcpy(&ctx->init_ctx, &ctx->ctx, sizeof(ctx->ctx));
 
   return GNUTLS_E_SUCCESS;
 }
@@ -204,7 +201,7 @@ wrap_nettle_hmac_reset (void *_ctx)
 {
   struct nettle_hmac_ctx *ctx = _ctx;
 
-  ctx->setkey (ctx->ctx_ptr, ctx->key_size, ctx->key);
+  memcpy(&ctx->ctx, &ctx->init_ctx, sizeof(ctx->ctx));
 }
 
 static int
@@ -220,9 +217,6 @@ wrap_nettle_hmac_update (void *_ctx, const void *text, 
size_t textsize)
 static void
 wrap_nettle_hmac_deinit (void *hd)
 {
-  struct nettle_hmac_ctx *ctx = hd;
-
-  gnutls_free (ctx->key);
   gnutls_free (hd);
 }
 


hooks/post-receive
-- 
GNU gnutls



reply via email to

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