aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/transforms/rsa/rsa_public_key.c
diff options
context:
space:
mode:
authorJan Hutter <jhutter@hsr.ch>2005-12-06 15:46:04 +0000
committerJan Hutter <jhutter@hsr.ch>2005-12-06 15:46:04 +0000
commit4b41a0d4047fa483578f458ef21af5cad64b572b (patch)
treea6b574dad384581dc8305b36fc57a1bf8bf049ec /Source/charon/transforms/rsa/rsa_public_key.c
parent6f36717843c71a46c5cfb8d4d4f9b74d0585de1f (diff)
downloadstrongswan-4b41a0d4047fa483578f458ef21af5cad64b572b.tar.bz2
strongswan-4b41a0d4047fa483578f458ef21af5cad64b572b.tar.xz
- code cleaned up
Diffstat (limited to 'Source/charon/transforms/rsa/rsa_public_key.c')
-rw-r--r--Source/charon/transforms/rsa/rsa_public_key.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/Source/charon/transforms/rsa/rsa_public_key.c b/Source/charon/transforms/rsa/rsa_public_key.c
index 72520cd22..9547b23d6 100644
--- a/Source/charon/transforms/rsa/rsa_public_key.c
+++ b/Source/charon/transforms/rsa/rsa_public_key.c
@@ -28,11 +28,12 @@
#include <utils/allocator.h>
#include <transforms/hashers/hasher.h>
-/* since we don't have an ASN1 parser/generator,
+/*
+ * Since we don't have an ASN1 parser/generator,
* we use these predefined values for
* hash algorithm oids. These also contain
* the length of the following hash.
- * These values are also used in rsa_private_key.c
+ * These values are also used in rsa_private_key.c.
*/
u_int8_t md2_oid[18] = {
@@ -74,7 +75,7 @@ u_int8_t sha512_oid[] = {
typedef struct private_rsa_public_key_t private_rsa_public_key_t;
/**
- * private data structure with signing context.
+ * Private data structure with signing context.
*/
struct private_rsa_public_key_t {
/**
@@ -83,38 +84,45 @@ struct private_rsa_public_key_t {
rsa_public_key_t public;
/**
- * is the key already set ?
+ * Is the key already set ?
*/
bool is_key_set;
/**
- * public modulus
+ * Public modulus.
*/
mpz_t n;
/**
- * public exponent
+ * Public exponent.
*/
mpz_t e;
/**
- * keysize in bytes
+ * Keysize in bytes.
*/
size_t k;
/**
* @brief Implements the RSAEP algorithm specified in PKCS#1.
+ *
+ * @param this calling object
+ * @param data data to process
+ * @return processed data
*/
chunk_t (*rsaep) (private_rsa_public_key_t *this, chunk_t data);
/**
* @brief Implements the RSASVP1 algorithm specified in PKCS#1.
+ *
+ * @param this calling object
+ * @param data data to process
+ * @return processed data
*/
chunk_t (*rsavp1) (private_rsa_public_key_t *this, chunk_t data);
};
/**
- * Implements private_rsa_public_key_t.rsadp
- * Implements private_rsa_public_key_t.rsavp1
+ * Implementation of private_rsa_public_key_t.rsadp and private_rsa_public_key_t.rsavp1
*/
static chunk_t rsaep(private_rsa_public_key_t *this, chunk_t data)
{
@@ -138,7 +146,7 @@ static chunk_t rsaep(private_rsa_public_key_t *this, chunk_t data)
}
/**
- * implementation of rsa_public_key.verify_emsa_signature.
+ * Implementation of rsa_public_key.verify_emsa_signature.
*/
static status_t verify_emsa_pkcs1_signature(private_rsa_public_key_t *this, chunk_t data, chunk_t signature)
{
@@ -266,7 +274,7 @@ static status_t verify_emsa_pkcs1_signature(private_rsa_public_key_t *this, chun
}
/**
- * implementation of rsa_public_key.set_key.
+ * Implementation of rsa_public_key.set_key.
*/
static status_t set_key(private_rsa_public_key_t *this, chunk_t key)
{
@@ -289,7 +297,7 @@ static status_t set_key(private_rsa_public_key_t *this, chunk_t key)
/**
- * implementation of rsa_public_key.get_key.
+ * Implementation of rsa_public_key.get_key.
*/
static status_t get_key(private_rsa_public_key_t *this, chunk_t *key)
{
@@ -316,7 +324,7 @@ static status_t get_key(private_rsa_public_key_t *this, chunk_t *key)
}
/**
- * implementation of rsa_public_key.load_key.
+ * Implementation of rsa_public_key.load_key.
*/
static status_t load_key(private_rsa_public_key_t *this, char *file)
{
@@ -324,7 +332,7 @@ static status_t load_key(private_rsa_public_key_t *this, char *file)
}
/**
- * implementation of rsa_public_key.save_key.
+ * Implementation of rsa_public_key.save_key.
*/
static status_t save_key(private_rsa_public_key_t *this, char *file)
{
@@ -332,7 +340,7 @@ static status_t save_key(private_rsa_public_key_t *this, char *file)
}
/**
- * implementation of rsa_public_key.destroy.
+ * Implementation of rsa_public_key.destroy.
*/
static void destroy(private_rsa_public_key_t *this)
{
@@ -345,7 +353,7 @@ static void destroy(private_rsa_public_key_t *this)
}
/*
- * Described in header
+ * Described in header.
*/
rsa_public_key_t *rsa_public_key_create()
{