diff options
author | Martin Willi <martin@strongswan.org> | 2005-11-24 11:30:19 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2005-11-24 11:30:19 +0000 |
commit | 5796aa164d79b2ffaf2839b281d490be6a72d1d8 (patch) | |
tree | 4031a623426b19bf03b2c61cd73a504e218fb1fb /Source/charon/transforms | |
parent | 95c61cb956505cdb0a91c8c8cd134dda3aac744d (diff) | |
download | strongswan-5796aa164d79b2ffaf2839b281d490be6a72d1d8.tar.bz2 strongswan-5796aa164d79b2ffaf2839b281d490be6a72d1d8.tar.xz |
- typedefs changed
Diffstat (limited to 'Source/charon/transforms')
-rw-r--r-- | Source/charon/transforms/crypters/crypter.h | 6 | ||||
-rw-r--r-- | Source/charon/transforms/diffie_hellman.c | 12 | ||||
-rw-r--r-- | Source/charon/transforms/diffie_hellman.h | 6 | ||||
-rw-r--r-- | Source/charon/transforms/hashers/hasher.h | 12 | ||||
-rw-r--r-- | Source/charon/transforms/hashers/hasher_md5.c | 6 | ||||
-rw-r--r-- | Source/charon/transforms/hashers/hasher_md5.h | 6 | ||||
-rw-r--r-- | Source/charon/transforms/hashers/hasher_sha1.c | 6 | ||||
-rw-r--r-- | Source/charon/transforms/hashers/hasher_sha1.h | 6 | ||||
-rw-r--r-- | Source/charon/transforms/hmac.c | 10 | ||||
-rw-r--r-- | Source/charon/transforms/hmac.h | 31 | ||||
-rw-r--r-- | Source/charon/transforms/prf_plus.c | 6 | ||||
-rw-r--r-- | Source/charon/transforms/prf_plus.h | 6 | ||||
-rw-r--r-- | Source/charon/transforms/prfs/prf.h | 10 | ||||
-rw-r--r-- | Source/charon/transforms/prfs/prf_hmac.c | 4 | ||||
-rw-r--r-- | Source/charon/transforms/prfs/prf_hmac.h | 6 | ||||
-rw-r--r-- | Source/charon/transforms/signers/signer.h | 6 |
16 files changed, 77 insertions, 62 deletions
diff --git a/Source/charon/transforms/crypters/crypter.h b/Source/charon/transforms/crypters/crypter.h index 97a8ad81d..3d5a6869b 100644 --- a/Source/charon/transforms/crypters/crypter.h +++ b/Source/charon/transforms/crypters/crypter.h @@ -26,12 +26,12 @@ #include <encoding/payloads/transform_substructure.h> +typedef struct crypter_t crypter_t; + /** * Object representing a crypter object */ -typedef struct crypter_s crypter_t; - -struct crypter_s { +struct crypter_t { /** * @brief Encrypt a chunk of data and allocate space for * the encrypted value. diff --git a/Source/charon/transforms/diffie_hellman.c b/Source/charon/transforms/diffie_hellman.c index 2acd0d960..e018675fe 100644 --- a/Source/charon/transforms/diffie_hellman.c +++ b/Source/charon/transforms/diffie_hellman.c @@ -289,12 +289,12 @@ static u_int8_t group18_modulus[] = { 0x60,0xC9,0x80,0xDD,0x98,0xED,0xD3,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, }; +typedef struct modulus_info_entry_t modulus_info_entry_t; + /** * Entry of the modulus list */ -typedef struct modulus_info_entry_s modulus_info_entry_t; - -struct modulus_info_entry_s{ +struct modulus_info_entry_t { /** * Group number as it is defined in transform_substructure.h */ @@ -328,13 +328,13 @@ static modulus_info_entry_t modulus_info_entries[] = { {MODP_8192_BIT,group18_modulus,sizeof(group18_modulus),2}, }; +typedef struct private_diffie_hellman_t private_diffie_hellman_t; + /** * Private data of an diffie_hellman_t object. * */ -typedef struct private_diffie_hellman_s private_diffie_hellman_t; - -struct private_diffie_hellman_s { +struct private_diffie_hellman_t { /** * public diffie_hellman_t interface */ diff --git a/Source/charon/transforms/diffie_hellman.h b/Source/charon/transforms/diffie_hellman.h index e775cbb15..ab1672d32 100644 --- a/Source/charon/transforms/diffie_hellman.h +++ b/Source/charon/transforms/diffie_hellman.h @@ -26,13 +26,13 @@ #include <types.h> #include <encoding/payloads/transform_substructure.h> +typedef struct diffie_hellman_t diffie_hellman_t; + /** * Object representing a diffie hellman exchange * */ -typedef struct diffie_hellman_s diffie_hellman_t; - -struct diffie_hellman_s { +struct diffie_hellman_t { /** * @brief Returns the shared secret of this diffie hellman exchange diff --git a/Source/charon/transforms/hashers/hasher.h b/Source/charon/transforms/hashers/hasher.h index a20ec6813..8b4699a3e 100644 --- a/Source/charon/transforms/hashers/hasher.h +++ b/Source/charon/transforms/hashers/hasher.h @@ -26,23 +26,23 @@ #include <types.h> +typedef enum hash_algorithm_t hash_algorithm_t; + /** * algorithms to use for hashing */ -typedef enum hash_algorithm_e hash_algorithm_t; - -enum hash_algorithm_e { +enum hash_algorithm_t { HASH_SHA1, HASH_MD5 }; +typedef struct hasher_t hasher_t; + /** * Object representing a hasher */ -typedef struct hasher_s hasher_t; - -struct hasher_s { +struct hasher_t { /** * @brief hash data and write it in the buffer * diff --git a/Source/charon/transforms/hashers/hasher_md5.c b/Source/charon/transforms/hashers/hasher_md5.c index f671bef6c..bfdd96785 100644 --- a/Source/charon/transforms/hashers/hasher_md5.c +++ b/Source/charon/transforms/hashers/hasher_md5.c @@ -98,12 +98,12 @@ Rotation is separate from addition to prevent recomputation. +typedef struct private_hasher_md5_t private_hasher_md5_t; + /** * private data structure with hasing context */ -typedef struct private_hasher_md5_s private_hasher_md5_t; - -struct private_hasher_md5_s { +struct private_hasher_md5_t { /** * public interface for this hasher */ diff --git a/Source/charon/transforms/hashers/hasher_md5.h b/Source/charon/transforms/hashers/hasher_md5.h index cc7c6c32a..d7e9124ee 100644 --- a/Source/charon/transforms/hashers/hasher_md5.h +++ b/Source/charon/transforms/hashers/hasher_md5.h @@ -27,13 +27,13 @@ #include <transforms/hashers/hasher.h> +typedef struct hasher_md5_t hasher_md5_t; + /** * Object representing the md5 hasher * */ -typedef struct hasher_md5_s hasher_md5_t; - -struct hasher_md5_s { +struct hasher_md5_t { /** * generic hasher_t interface for this hasher diff --git a/Source/charon/transforms/hashers/hasher_sha1.c b/Source/charon/transforms/hashers/hasher_sha1.c index b8a7d14cc..75057457a 100644 --- a/Source/charon/transforms/hashers/hasher_sha1.c +++ b/Source/charon/transforms/hashers/hasher_sha1.c @@ -53,12 +53,12 @@ #define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); +typedef struct private_hasher_sha1_t private_hasher_sha1_t; + /** * private data structure with hasing context */ -typedef struct private_hasher_sha1_s private_hasher_sha1_t; - -struct private_hasher_sha1_s { +struct private_hasher_sha1_t { /** * public interface for this hasher */ diff --git a/Source/charon/transforms/hashers/hasher_sha1.h b/Source/charon/transforms/hashers/hasher_sha1.h index 76aa9049c..1f96d5d72 100644 --- a/Source/charon/transforms/hashers/hasher_sha1.h +++ b/Source/charon/transforms/hashers/hasher_sha1.h @@ -27,13 +27,13 @@ #include <transforms/hashers/hasher.h> +typedef struct hasher_sha1_t hasher_sha1_t; + /** * Object representing the sha1 hasher * */ -typedef struct hasher_sha1_s hasher_sha1_t; - -struct hasher_sha1_s { +struct hasher_sha1_t { /** * generic hasher_t interface for this hasher diff --git a/Source/charon/transforms/hmac.c b/Source/charon/transforms/hmac.c index 760d56218..589716f9d 100644 --- a/Source/charon/transforms/hmac.c +++ b/Source/charon/transforms/hmac.c @@ -1,9 +1,7 @@ /** * @file hmac.c * - * @brief Implementation of message authentication - * using cryptographic hash functions (HMAC). See RFC2104. - * + * @brief Implementation of hmac_t */ /* @@ -26,13 +24,13 @@ #include <utils/allocator.h> +typedef struct private_hmac_t private_hmac_t; + /** * Private data of an hmac_t object. * */ -typedef struct private_hmac_s private_hmac_t; - -struct private_hmac_s { +struct private_hmac_t { /** * public hmac_t interface */ diff --git a/Source/charon/transforms/hmac.h b/Source/charon/transforms/hmac.h index 6de424783..384f47dc9 100644 --- a/Source/charon/transforms/hmac.h +++ b/Source/charon/transforms/hmac.h @@ -1,9 +1,7 @@ /** * @file hmac.h * - * @brief Implementation of message authentication - * using cryptographic hash functions (HMAC). See RFC2104. - * + * @brief Interface of hmac_t. */ /* @@ -24,16 +22,25 @@ #ifndef HMAC_H_ #define HMAC_H_ - #include <transforms/hashers/hasher.h> +#include <definitions.h> + + +typedef struct hmac_t hmac_t; /** - * Object representing a hmac + * @brief Message authentication based using hash functions. + * + * This class implements the message authenticaion algorithm + * described in RFC2104. It uses a hash function, wich must + * be implemented as a hasher_t class. + * + * @see hasher_t, prf_hmac_t + * + * @ingroup transforms */ -typedef struct hmac_s hmac_t; - -struct hmac_s { +struct hmac_t { /** * @brief Generate message authentication code. * @@ -98,13 +105,19 @@ struct hmac_s { }; /** - * Creates a new hmac_t object + * @brief Creates a new hmac_t object. + * + * Creates a new hmac_t object using sing hash_algorithm to + * create a hasher_t internally. * * @param hash_algorithm hash algorithm to use * @return * - hmac_t if successfully * - NULL if out of ressources or hash not supported + * + * @ingroup transforms */ hmac_t *hmac_create(hash_algorithm_t hash_algorithm); + #endif /*HMAC_H_*/ diff --git a/Source/charon/transforms/prf_plus.c b/Source/charon/transforms/prf_plus.c index 4b1185dd8..2c6e16b00 100644 --- a/Source/charon/transforms/prf_plus.c +++ b/Source/charon/transforms/prf_plus.c @@ -26,13 +26,13 @@ #include <utils/allocator.h> #include <definitions.h> +typedef struct private_prf_plus_t private_prf_plus_t; + /** * Private data of an prf_plus_t object. * */ -typedef struct private_prf_plus_s private_prf_plus_t; - -struct private_prf_plus_s { +struct private_prf_plus_t { /** * public prf_plus_t interface */ diff --git a/Source/charon/transforms/prf_plus.h b/Source/charon/transforms/prf_plus.h index 51af4d36c..fb0e4cac0 100644 --- a/Source/charon/transforms/prf_plus.h +++ b/Source/charon/transforms/prf_plus.h @@ -27,12 +27,12 @@ #include <transforms/prfs/prf.h> +typedef struct prf_plus_t prf_plus_t; + /** * Object representing a prf_plus */ -typedef struct prf_plus_s prf_plus_t; - -struct prf_plus_s { +struct prf_plus_t { /** * @brief Get pseudo random bytes. * diff --git a/Source/charon/transforms/prfs/prf.h b/Source/charon/transforms/prfs/prf.h index da624a0f0..2b6aab46e 100644 --- a/Source/charon/transforms/prfs/prf.h +++ b/Source/charon/transforms/prfs/prf.h @@ -26,12 +26,14 @@ #include <encoding/payloads/transform_substructure.h> +typedef struct prf_t prf_t; + /** * Object representing a diffie hellman exchange + * + * @ingroup prfs */ -typedef struct prf_s prf_t; - -struct prf_s { +struct prf_t { /** * @brief generates pseudo random bytes and writes them * in the buffer @@ -89,6 +91,8 @@ struct prf_s { * @return * - prf_t if successfully * - NULL if out of ressources or prf not supported + * + * @ingroup prfs */ prf_t *prf_create(pseudo_random_function_t pseudo_random_function); diff --git a/Source/charon/transforms/prfs/prf_hmac.c b/Source/charon/transforms/prfs/prf_hmac.c index 9668e1b41..fdcce4af2 100644 --- a/Source/charon/transforms/prfs/prf_hmac.c +++ b/Source/charon/transforms/prfs/prf_hmac.c @@ -26,9 +26,9 @@ #include <utils/allocator.h> #include <transforms/hmac.h> -typedef struct private_prf_hmac_s private_prf_hmac_t; +typedef struct private_prf_hmac_t private_prf_hmac_t; -struct private_prf_hmac_s { +struct private_prf_hmac_t { /** * public interface for this prf */ diff --git a/Source/charon/transforms/prfs/prf_hmac.h b/Source/charon/transforms/prfs/prf_hmac.h index 22e993bee..427cdd4d7 100644 --- a/Source/charon/transforms/prfs/prf_hmac.h +++ b/Source/charon/transforms/prfs/prf_hmac.h @@ -29,13 +29,13 @@ #include <types.h> #include <transforms/hashers/hasher.h> +typedef struct prf_hmac_t prf_hmac_t; + /** * Object representing a prf using HMAC * */ -typedef struct prf_hmac_s prf_hmac_t; - -struct prf_hmac_s { +struct prf_hmac_t { /** * generic prf_t interface for this prf diff --git a/Source/charon/transforms/signers/signer.h b/Source/charon/transforms/signers/signer.h index d179b1317..b0a107e2f 100644 --- a/Source/charon/transforms/signers/signer.h +++ b/Source/charon/transforms/signers/signer.h @@ -26,12 +26,12 @@ #include <encoding/payloads/transform_substructure.h> +typedef struct signer_t signer_t; + /** * Object representing a diffie hellman exchange */ -typedef struct signer_s signer_t; - -struct signer_s { +struct signer_t { /** * @brief generates pseudo random bytes and writes them * in the buffer |