From 89c9e521baa2c03c1a354dacc01eaa2bf0aa40e0 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Mon, 9 Jul 2007 17:34:30 +0000 Subject: [PATCH] updates. --- CHANGES.RUNTIME | 18 +++++++++++ TODO | 78 +++------------------------------------------- distdir/common | 3 ++ includes/silc.h.in | 3 +- 4 files changed, 28 insertions(+), 74 deletions(-) diff --git a/CHANGES.RUNTIME b/CHANGES.RUNTIME index 55a723dc..e8410c93 100644 --- a/CHANGES.RUNTIME +++ b/CHANGES.RUNTIME @@ -1,3 +1,21 @@ +Mon Jul 9 20:21:13 EEST 2007 Pekka Riikonen + + * 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 * Moved Base64 routines to lib/silcutil/silcbase64.[ch]. Added diff --git a/TODO b/TODO index a8144872..15ddae4f 100644 --- 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 diff --git a/distdir/common b/distdir/common index 100936f9..47307dec 100644 --- a/distdir/common +++ b/distdir/common @@ -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 diff --git a/includes/silc.h.in b/includes/silc.h.in index 5c63c403..10040866 100644 --- a/includes/silc.h.in +++ b/includes/silc.h.in @@ -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" -- 2.24.0