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_13-6-g11722af


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_3_0_13-6-g11722af
Date: Sun, 19 Feb 2012 11:16:24 +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=11722af465b4e8999d16630067b17ddc64f819ec

The branch, master has been updated
       via  11722af465b4e8999d16630067b17ddc64f819ec (commit)
      from  f13b70b7176424c0c78d69972c105b2065643b3f (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 11722af465b4e8999d16630067b17ddc64f819ec
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Feb 19 12:21:52 2012 +0100

    register the .fast function for cryptodev

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

Summary of changes:
 lib/accelerated/cryptodev.c |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/lib/accelerated/cryptodev.c b/lib/accelerated/cryptodev.c
index da68474..7a34c0c 100644
--- a/lib/accelerated/cryptodev.c
+++ b/lib/accelerated/cryptodev.c
@@ -360,6 +360,40 @@ cryptodev_mac_output (void *_ctx, void *digest, size_t 
digestsize)
   return 0;
 }
 
+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)
+{
+int mac = gnutls_mac_map[algorithm];
+struct session_op sess; 
+struct crypt_op cryp;
+
+  sess.mac = mac;
+  sess.mackey = key;
+  sess.mackeylen = keysize;
+
+  if (ioctl (cryptodev_fd, CIOCGSESSION, &sess))
+    {
+      gnutls_assert ();
+      return GNUTLS_E_CRYPTODEV_IOCTL_ERROR;
+    }
+  cryp.ses = sess.ses;
+  cryp.len = text_size;
+  cryp.src = (void *) text;
+  cryp.dst = NULL;
+  cryp.mac = digest;
+  cryp.op = COP_ENCRYPT;
+
+  if (ioctl (cryptodev_fd, CIOCCRYPT, &cryp))
+    {
+      gnutls_assert ();
+      return GNUTLS_E_CRYPTODEV_IOCTL_ERROR;
+    }
+  
+  return 0;
+}
+
 #define cryptodev_mac_deinit cryptodev_deinit
 
 static const gnutls_crypto_mac_st mac_struct = {
@@ -368,6 +402,7 @@ static const gnutls_crypto_mac_st mac_struct = {
   .hash = cryptodev_mac_hash,
   .output = cryptodev_mac_output,
   .deinit = cryptodev_mac_deinit
+  .fast = cryptodev_mac_fast
 };
 
 static int


hooks/post-receive
-- 
GNU gnutls



reply via email to

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