updates.
authorPekka Riikonen <priikone@silcnet.org>
Mon, 9 Jul 2007 17:34:30 +0000 (17:34 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Mon, 9 Jul 2007 17:34:30 +0000 (17:34 +0000)
CHANGES.RUNTIME
TODO
distdir/common
includes/silc.h.in

index 55a723dcc17f8b65a52ed15b442513bdde76f24b..e8410c936deb4ff326e973c4a9aa31de664cfacb 100644 (file)
@@ -1,3 +1,21 @@
+Mon Jul  9 20:21:13 EEST 2007  Pekka Riikonen <priikone@silcnet.org>
+
+       * Added SILC Accelerator Library.  Provides generic way to
+         use accelerators with crypto library.  Affected files are in
+         lib/silcacc/.
+
+       * Added software accelerator, a thread pool system that off-loads
+         public and private key operations to threads.  Affected files
+         are lib/silcacc/softacc.[ch].
+
+       * Changed thread pool completion callback to SilcTaskCallback so
+         that it can be given directly to destination scheduler.
+         Affected files are lib/silcutil/silcthread.[ch].
+
+       * Added SilcPKCSAlgorithm context to SilcPublicKey and
+         SilcPrivateKey contexts.  Affected files are 
+         lib/silccrypt/silcpkcs.[ch], silcpk.c.
+
 Sun Jul  8 20:20:22 EEST 2007  Pekka Riikonen <priikone@silcnet.org>
 
        * Moved Base64 routines to lib/silcutil/silcbase64.[ch].  Added
diff --git a/TODO b/TODO
index a8144872547ee1690cac3956e881423061fd7c7c..15ddae4f963ce24ac419180a0420db6d277a47a3 100644 (file)
--- a/TODO
+++ b/TODO
@@ -335,83 +335,15 @@ SILC Accelerator Library
  o SILC Accelerator API.  Provides generic way to use different kind of
    accelerators.  Basically implements SILC PKCS API so that SilcPublicKey
    and SilcPrivateKey can be used but they call the accelerators.
+   (***DONE)
 
-   Something in the lines of (preliminary):
-
-   /* Register accelerator to system.  Initializes the accelerator. */
-      Varargs are optional accelerator specific init parameteres. */
-   SilcBool silc_acc_register(SilcAccelerator acc, ...);
-
-     silc_acc_register(softacc, "min_threads", 2, "max_threads", 16, NULL);
-
-   /* Unregister accelerator.  Uninitializes the accelerator. */
-   SilcBool silc_acc_unregister(const SilcAccelerator acc);
-
-   /* Return list of the registered accelerators */
-   SilcDList silc_acc_get_supported(void);
-
-   /* Find existing accelerator.  `name' is accelerator's name. */
-   SilcAccelerator silc_acc_find(const char *name);
-
-   /* Return accelerator's name */
-   const char *silc_acc_get_name(SilcAccelerator acc);
-
-   /* Accelerate `public_key'.  Return accelerated public key. */
-   SilcPublicKey silc_acc_public_key(SilcAccelerator acc,
-                                    SilcPublicKey public_key);
-
-   /* Accelerate `private_key'.  Returns accelerated private key. */
-   SilcPrivateKey silc_acc_private_key(SilcAccelerator acc,
-                                      SilcPrivateKey private_key);
-
-   /* Return the underlaying public key */
-   SilcPublicKey silc_acc_get_public_key(SilcAccelerator acc,
-                                        SilcPublicKey public_key);
-
-   /* Return the underlaying private key */
-   SilcPrivateKey silc_acc_get_private_key(SilcAccelerator acc,
-                                          SilcPrivateKey private_key);
-
-   typedef struct SilcAcceleratorObject {
-     const char *name;                 /* Accelerator's name */
-     SilcBool (*init)(va_list va);     /* Initialize accelerator */
-     SilcBool (*uninit)(void);         /* Uninitialize accelerator */
-     const SilcPKCSAlgorithm *pkcs;    /* Accelerated PKCS algorithms */
-     const SilcDHObject *dh;           /* Accelerated Diffie-Hellmans */
-     const SilcCipherObject *cipher;   /* Accelerated ciphers */
-     const SilcHashObject *hash;       /* Accelerated hashes */
-     const SilcHmacObject *hmac;       /* Accelerated HMACs */
-     const SilcRngObject *rng;         /* Accelerated RNG's */
-   } *SilcAccelerator, SilcAcceleratorStruct;
-
-   Allows accelerator to have multiple accelerators (cipher, hash etc)
-   and multiple different algorithms and implementations (SHA-1, SHA-256 etc).
-
-   SilcPublicKey->SilcSILCPublicKey->RsaPublicKey accelerated as:
-   SilcPublicKey->SilcAcceleratorPublicKey->SilcSoftAccPublicKey->
-     SilcPublicKey->SilcSILCPublicKey->RsaPublicKey
-
-   silc_acc_public_key creates SilcPublicKey and SilcAcceleratorPublicKey
-   and acc->pkcs->import_public_key creates SilcSoftAccPublicKey.
+ o Add complete wrapper for PKCS API in silcacc_pkcs.c.
 
  o Implement software accelerator.  It is a thread pool system where the
-   public key and private key operations are executed in threads.
+   public key and private key operations are executed in threads. 
+   (***DONE)
 
-   const struct SilcAcceleratorObject softacc =
-   {
-     "softacc", softacc_init, softacc_uninit,
-     softacc_pkcs, NULL, NULL, NULL, NULL
-   }
-
-   /* Called from silc_acc_private_key */
-   int silc_softacc_import_private_key(void *key, SilcUInt32 key_len,
-                                      void **ret_private_key)
-   {
-     SilcSoftAccPrivateKey prv = silc_calloc(1, sizeof(*prv));
-     prv->pkcs = acc->pkcs;
-     prv->private_key = key;
-     *ret_private_key = prv;
-   }
+ o Diffie-Hellman acceleration
 
  (o Symmetric key cryptosystem acceleration?  They are always sycnhronouos
    even with hardware acceleration so the crypto API shouldn't require
index 100936f9fec534a3a9da503a743dc66b919cffa0..47307dec6eac44c8bfc9011f6b8d7de423f4c0be 100644 (file)
@@ -19,5 +19,8 @@ define SILC_DIST_TMA
 # ASN.1 library
 define SILC_DIST_ASN1
 
+# Accelerator library
+define SILC_DIST_ACC
+
 # Key Repository library
 define SILC_DIST_SKR
index 5c63c403116d860844dfbb4789d322b76ccbbdd3..10040866ad42b8f8b314a53b388110704682e2cf 100644 (file)
@@ -238,6 +238,7 @@ extern "C" {
 #include "silcbuffer.h"
 #include "silcbuffmt.h"
 #include "silcasync.h"
+#include "silcdlist.h"
 
 /* Crypto library includes */
 #include "silccrypto.h"
@@ -248,12 +249,12 @@ extern "C" {
 #include "silcpkcs.h"
 #include "silcpk.h"
 #include "silcpkcs1.h"
+#include "silcacc.h"
 
 /* More SILC util library includes */
 #include "silcenv.h"
 #include "silcdll.h"
 #include "silchashtable.h"
-#include "silcdlist.h"
 #include "silcstream.h"
 #include "silcnet.h"
 #include "silcfileutil.h"