Added synchronous and asynchronous PKCS calls.
[crypto.git] / lib / silcacc / silcacc_pkcs.c
index d1b85e327d296d36430947fbf5cfff1313a3e200..9a0dba5cabdb330d46257a15f73ac65c60258e41 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2007 Pekka Riikonen
+  Copyright (C) 2007 -  2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silccrypto.h"
 
 /************************** Types and definitions ***************************/
 
@@ -252,7 +252,8 @@ SILC_PKCS_VERIFY(silc_acc_pkcs_verify)
   /* Accelerate */
   return pub->acc->pkcs[pub->pkcs_index].verify(
                       &pub->acc->pkcs[pub->pkcs_index], pub->context,
-                      signature, signature_len, data, data_len, hash, rng,
+                      signature, signature_len, data, data_len,
+                      compute_hash, hash, rng,
                       verify_cb, context);
 }
 
@@ -332,7 +333,7 @@ SilcPublicKey silc_acc_public_key(SilcAccelerator acc,
   /* Accelerate the public key.  Returns accelerator context. */
   if (!acc->pkcs[i].import_public_key(&acc->pkcs[i], public_key, 0,
                                      &acc_pubkey->context)) {
-    SILC_LOG_ERROR(("Error accelerating public key with accelerator '%s'",
+    SILC_LOG_DEBUG(("Error accelerating public key with accelerator '%s'",
                    acc->name));
     silc_free(acc_pubkey);
     silc_free(pubkey->pkcs);
@@ -417,7 +418,8 @@ SilcPrivateKey silc_acc_private_key(SilcAccelerator acc,
   acc_privkey->acc = acc;
   acc_privkey->pkcs_index = i;
 
-  /* Accelerate the public key.  Returns accelerator context. */
+  /* Accelerate the public key.  Returns accelerator context.  The
+     import_public_key operation is used to accelerate the key. */
   if (!acc->pkcs[i].import_private_key(&acc->pkcs[i], private_key, 0,
                                       &acc_privkey->context)) {
     SILC_LOG_ERROR(("Error accelerating private key with accelerator '%s'",