From 945c28478afe95e41b988c269e95b19f9bbf4102 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 30 Dec 2007 18:52:01 +0000 Subject: [PATCH] Add some doxygen. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22385 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hcrypto/rsa.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/lib/hcrypto/rsa.c b/lib/hcrypto/rsa.c index 15656a92e..935e7a72a 100644 --- a/lib/hcrypto/rsa.c +++ b/lib/hcrypto/rsa.c @@ -46,12 +46,39 @@ RCSID("$Id$"); #include +/** + * @page page_rsa RSA - public-key cryptography + * + * RSA is named by its inventors (Ron Rivest, Adi Shamir, and Leonard + * Adleman) (published in 1977), patented expired in 21 September 2000. + * + * See the library functions here: @ref hcrypto_rsa + */ + +/** + * Same as RSA_new_method() using NULL as engine. + * + * @return a newly allocated RSA object. Free with RSA_free(). + * + * @ingroup hcrypto_rsa + */ + RSA * RSA_new(void) { return RSA_new_method(NULL); } +/** + * Allocate a new RSA object using the engine, if NULL is specified as + * the engine, use the default RSA engine as returned by + * ENGINE_get_default_RSA(). + * + * @return a newly allocated RSA object. Free with RSA_free(). + * + * @ingroup hcrypto_rsa + */ + RSA * RSA_new_method(ENGINE *engine) { @@ -87,6 +114,12 @@ RSA_new_method(ENGINE *engine) return rsa; } +/** + * Free an allocation RSA object. + * + * @param rsa the RSA object to free. + * @ingroup hcrypto_rsa + */ void RSA_free(RSA *rsa) @@ -117,6 +150,18 @@ RSA_free(RSA *rsa) free(rsa); } +/** + * Add an extra reference to the RSA object. The object should be free + * with RSA_free() to drop the reference. + * + * @param rsa the object to add reference counting too. + * + * @return the current reference count, can't safely be used except + * for debug printing. + * + * @ingroup hcrypto_rsa + */ + int RSA_up_ref(RSA *rsa) { @@ -296,7 +341,11 @@ RSA_null_method(void) } extern const RSA_METHOD hc_rsa_imath_method; +#ifdef HAVE_GMP +static const RSA_METHOD *default_rsa_method = &hc_rsa_gmp_method; +#else static const RSA_METHOD *default_rsa_method = &hc_rsa_imath_method; +#endif const RSA_METHOD * RSA_get_default_method(void) -- 2.11.4.GIT