X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilccrypt%2Frsa.h;h=6a9506a4aadf5896080f723d632d9a18808c4b29;hb=e7b6c157b80152bf9fb9266e6bdd93f9fb0db776;hp=0b05728e86a1754e4f9be554b8fb8cd3e3bb50e1;hpb=410642a14d4185abd75715cee3f5177cd55b1ceb;p=silc.git diff --git a/lib/silccrypt/rsa.h b/lib/silccrypt/rsa.h index 0b05728e..6a9506a4 100644 --- a/lib/silccrypt/rsa.h +++ b/lib/silccrypt/rsa.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -22,14 +22,13 @@ /* 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 */