diff options
author | Jan Hutter <jhutter@hsr.ch> | 2005-12-06 15:37:56 +0000 |
---|---|---|
committer | Jan Hutter <jhutter@hsr.ch> | 2005-12-06 15:37:56 +0000 |
commit | 6f36717843c71a46c5cfb8d4d4f9b74d0585de1f (patch) | |
tree | ffa1345c68767e8660a6bf917eeef9d5ce15b947 /Source/charon/transforms/prfs/prf.h | |
parent | 62abe4a37dade51bc122e97d566ec7b728648638 (diff) | |
download | strongswan-6f36717843c71a46c5cfb8d4d4f9b74d0585de1f.tar.bz2 strongswan-6f36717843c71a46c5cfb8d4d4f9b74d0585de1f.tar.xz |
- code cleaned up
Diffstat (limited to 'Source/charon/transforms/prfs/prf.h')
-rw-r--r-- | Source/charon/transforms/prfs/prf.h | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/Source/charon/transforms/prfs/prf.h b/Source/charon/transforms/prfs/prf.h index 470556dc8..d96fc66ae 100644 --- a/Source/charon/transforms/prfs/prf.h +++ b/Source/charon/transforms/prfs/prf.h @@ -1,7 +1,7 @@ /** * @file prf.h * - * @brief Interface of prf_t. + * @brief Interface prf_t. * */ @@ -29,17 +29,29 @@ typedef enum pseudo_random_function_t pseudo_random_function_t; /** * @brief Pseudo random function, as in IKEv2 draft 3.3.2. + * + * Currently only the following algorithms are implemented and therefore supported: + * - PRF_HMAC_MD5 + * - PRF_HMAC_SHA1 + * + * @ingroup prfs */ enum pseudo_random_function_t { PRF_UNDEFINED = 1024, + /** + * Implemented in class hmac_prf_t. + */ PRF_HMAC_MD5 = 1, + /** + * Implemented in class hmac_prf_t. + */ PRF_HMAC_SHA1 = 2, PRF_HMAC_TIGER = 3, PRF_AES128_CBC = 4 }; /** - * string mappings for encryption_algorithm_t + * String mappings for encryption_algorithm_t. */ extern mapping_t pseudo_random_function_m[]; @@ -49,59 +61,65 @@ typedef struct prf_t prf_t; /** * @brief Generic interface for pseudo-random-functions. * + * @b Constructors: + * - prf_create() + * - hmac_prf_create() + * + * @todo Implement more prf algorithms + * * @ingroup prfs */ struct prf_t { /** - * @brief generates pseudo random bytes and writes them + * @brief Generates pseudo random bytes and writes them * in the buffer. * - * @param this calling prf + * @param this calling object * @param seed a chunk containing the seed for the next bytes * @param[out] buffer pointer where the generated bytes will be written */ void (*get_bytes) (prf_t *this, chunk_t seed, u_int8_t *buffer); /** - * @brief generates pseudo random bytes and allocate space for them. + * @brief Generates pseudo random bytes and allocate space for them. * - * @param this calling prf + * @param this calling object * @param seed a chunk containing the seed for the next bytes * @param[out] chunk chunk which will hold generated bytes */ void (*allocate_bytes) (prf_t *this, chunk_t seed, chunk_t *chunk); /** - * @brief get the block size of this prf. + * @brief Get the block size of this prf_t object. * - * @param this calling prf + * @param this calling object * @return block size in bytes */ size_t (*get_block_size) (prf_t *this); /** - * @brief Set the key for this prf. + * @brief Set the key for this prf_t object. * - * @param this calling prf + * @param this calling object * @param key key to set */ void (*set_key) (prf_t *this, chunk_t key); /** - * @brief Destroys a prf object.. + * @brief Destroys a prf object. * - * @param this prf_t object to destroy + * @param this calling object */ void (*destroy) (prf_t *this); }; /** - * @brief Generic constructor for a prf_t. + * @brief Generic constructor for a prf_t oject. * * @param pseudo_random_function Algorithm to use * @return - * - prf_t if successfully - * - NULL if prf not supported + * - prf_t object + * - NULL if prf algorithm not supported * * @ingroup prfs */ |