diff options
author | Martin Willi <martin@strongswan.org> | 2005-11-26 15:43:59 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2005-11-26 15:43:59 +0000 |
commit | f1c91cf037689979049f4904fd3d76f85cd98981 (patch) | |
tree | 88df638b2769f393bacee4df3c5dca6c5fa79f48 /Source/charon | |
parent | 76a6c74719b6fba19191b910a249d029eafb5e18 (diff) | |
download | strongswan-f1c91cf037689979049f4904fd3d76f85cd98981.tar.bz2 strongswan-f1c91cf037689979049f4904fd3d76f85cd98981.tar.xz |
- tested code-example
Diffstat (limited to 'Source/charon')
-rw-r--r-- | Source/charon/definitions.h | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/Source/charon/definitions.h b/Source/charon/definitions.h index 03fd74b29..54a8f242c 100644 --- a/Source/charon/definitions.h +++ b/Source/charon/definitions.h @@ -59,9 +59,6 @@ #error "BYTE_ORDER must be defined" #endif -/** - * Doxygen namespace support - */ /** @@ -100,7 +97,31 @@ /** * @addtogroup hashers * - * Hash algorithms + * Hashing algorithms. + * + * Example for using hasher_t: + * @code + * chunk_t data; + * chunk_t md5_hash; + * u_int8_t sha1_hash[20]; + * + * hasher_t *hasher; + * + * data.ptr = "string to hash"; + * data.len = strlen(data.ptr); + * + * // use MD5, allocate hash + * hasher = hasher_create(HASH_MD5); + * hasher->allocate_hash(hasher, data, &hash); + * hasher->destroy(hasher); + * + * // use SHA1, hash in buffer + * hasher = hasher_create(HASH_SHA1); + * hasher->get_hash(hasher, data, &sha1_hash); + * hasher->destroy(hasher); + * @endcode + * + * * * @ingroup transforms */ |