- moved algorithm definitions from payloads to corresponding transforms

- cleanup of docs in transforms
This commit is contained in:
Martin Willi
2005-11-24 16:22:04 +00:00
parent 2a1d820155
commit 8277be6053
28 changed files with 413 additions and 265 deletions
+9 -2
View File
@@ -1,7 +1,7 @@
/**
* @file hasher.c
*
* @brief Generic interface for hash functions
* @brief Generic constructor for hasher_t
*
*/
@@ -26,7 +26,14 @@
#include <transforms/hashers/hasher_sha1.h>
#include <transforms/hashers/hasher_md5.h>
/**
* mappings for hash_algorithm_t
*/
mapping_t hash_algorithm_m[] = {
{HASH_SHA1, "HASH_SHA1"},
{HASH_MD5, "HASH_MD5"},
{MAPPING_END, NULL}
};
/*
* Described in header
+19 -10
View File
@@ -1,7 +1,7 @@
/**
* @file hasher.h
*
* @brief Generic interface for hash functions
* @brief Interface for hasher_t.
*
*/
@@ -29,18 +29,25 @@
typedef enum hash_algorithm_t hash_algorithm_t;
/**
* algorithms to use for hashing
* @brief Algorithms to use for hashing.
*/
enum hash_algorithm_t {
HASH_SHA1,
HASH_MD5
};
/**
* string mappings for hash_algorithm_t
*/
extern mapping_t hash_algorithm_m[];
typedef struct hasher_t hasher_t;
/**
* Object representing a hasher
* @brief Generic interface for all hash functions.
*
* @ingroup hashers
*/
struct hasher_t {
/**
@@ -51,7 +58,7 @@ struct hasher_t {
* If not, the result is written back and the hasher is reset.
*
* @warning: the hash output parameter must hold at least
* #hash_t.get_block_size bytes.
* hash_t.get_block_size bytes.
*
* @param this calling hasher
* @param data data to hash
@@ -78,7 +85,7 @@ struct hasher_t {
status_t (*allocate_hash) (hasher_t *this, chunk_t data, chunk_t *hash);
/**
* @brief get the block size of this hashing function
* @brief Get the block size of this hashing function.
*
* @param this calling hasher
* @return block size in bytes
@@ -86,7 +93,7 @@ struct hasher_t {
size_t (*get_block_size) (hasher_t *this);
/**
* @brief reset the hashers state, which allows
* @brief Resets the hashers state, which allows
* computation of a completly new hash.
*
* @param this calling hasher
@@ -105,12 +112,14 @@ struct hasher_t {
};
/**
* Creates a new hasher_t object
* @brief Generic interface to create a hasher_t.
*
* @param hash_algorithm Algorithm to use for hashing
* @param hash_algorithm Algorithm to use for hashing
* @return
* - hasher_t if successfully
* - NULL if out of ressources
* - hasher_t if successfully
* - NULL if out of ressources
*
* @ingroup hashers
*/
hasher_t *hasher_create(hash_algorithm_t hash_algorithm);
@@ -1,8 +1,7 @@
/**
* @file hasher_md5.c
*
* @brief Implementation of hasher_t interface using the
* md5 algorithm.
* @brief Implementation of hasher_md5_t.
*
*/
@@ -1,8 +1,7 @@
/**
* @file hasher_md5.h
*
* @brief Implementation of hasher_t interface using the
* md5 algorithm.
* @brief Interface for hasher_md5_t.
*
*/
@@ -30,8 +29,10 @@
typedef struct hasher_md5_t hasher_md5_t;
/**
* Object representing the md5 hasher
* @brief Implementation of hasher_t interface using the
* MD5 algorithm.
*
* @ingroup hashers
*/
struct hasher_md5_t {
@@ -42,11 +43,13 @@ struct hasher_md5_t {
};
/**
* Creates a new hasher_md5_t object
* @brief Creates a new hasher_md5_t.
*
* @return
* - hasher_md5_t if successfully
* - NULL if out of ressources
* - hasher_md5_t if successfully
* - NULL if out of ressources
*
* @ingroup hashers
*/
hasher_md5_t *hasher_md5_create();
@@ -1,8 +1,7 @@
/**
* @file hasher_sha1.c
*
* @brief Implementation of hasher_t interface using the
* SHA1 algorithm.
* @brief Implementation of hasher_sha_t.
*
*/
@@ -1,8 +1,7 @@
/**
* @file hasher_sha1.h
*
* @brief Implementation of hasher_t interface using the
* SHA1 algorithm.
* @brief Interface for the hasher_sha1_t
*
*/
@@ -30,8 +29,10 @@
typedef struct hasher_sha1_t hasher_sha1_t;
/**
* Object representing the sha1 hasher
* @brief Implementation of hasher_t interface using the
* SHA1 algorithm.
*
* @ingroup hashers
*/
struct hasher_sha1_t {
@@ -42,11 +43,13 @@ struct hasher_sha1_t {
};
/**
* Creates a new hasher_sha1_t object
* @brief Creates a new hasher_sha1_t.
*
* @return
* - hasher_sha1_t if successfully
* - NULL if out of ressources
* - hasher_sha1_t if successfully
* - NULL if out of ressources
*
* @ingroup hashers
*/
hasher_sha1_t *hasher_sha1_create();