Added SILC Thread Queue API
[silc.git] / lib / silccrypt / rsa.h
index 0b05728e86a1754e4f9be554b8fb8cd3e3bb50e1..6a9506a4aadf5896080f723d632d9a18808c4b29 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2006 Pekka Riikonen
+  Copyright (C) 1997 - 2007 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
 
 /* RSA Public Key */
 typedef struct {
-  int bits;                    /* bits in key */
   SilcMPInt n;                 /* modulus */
   SilcMPInt e;                 /* public exponent */
+  int bits;                    /* bits in key */
 } RsaPublicKey;
 
 /* RSA Private Key */
 typedef struct {
-  int bits;                    /* bits in key */
   SilcMPInt n;                 /* modulus */
   SilcMPInt e;                 /* public exponent */
   SilcMPInt d;                 /* private exponent */
@@ -37,14 +36,15 @@ typedef struct {
   SilcMPInt q;                 /* CRT, q */
   SilcMPInt dP;                        /* CRT, d mod p - 1 */
   SilcMPInt dQ;                        /* CRT, d mod q - 1 */
-  SilcMPInt qP;                        /* CRT, q ^ -1 mod p */
+  SilcMPInt qP;                        /* CRT, q ^ -1 mod p (aka u, aka qInv) */
+  int bits;                    /* bits in key */
 } RsaPrivateKey;
 
-SilcBool rsa_generate_keys(SilcUInt32 bits, SilcMPInt *p, SilcMPInt *q,
-                          void **ret_public_key, void **ret_private_key);
-SilcBool rsa_public_operation(RsaPublicKey *key, SilcMPInt *src,
-                             SilcMPInt *dst);
-SilcBool rsa_private_operation(RsaPrivateKey *key, SilcMPInt *src,
-                              SilcMPInt *dst);
+SilcBool silc_rsa_generate_keys(SilcUInt32 bits, SilcMPInt *p, SilcMPInt *q,
+                               void **ret_public_key, void **ret_private_key);
+SilcBool silc_rsa_public_operation(RsaPublicKey *key, SilcMPInt *src,
+                                  SilcMPInt *dst);
+SilcBool silc_rsa_private_operation(RsaPrivateKey *key, SilcMPInt *src,
+                                   SilcMPInt *dst);
 
 #endif /* RSA_H */