fixed big endian bug in md5 hasher
[strongswan.git] / src / libstrongswan / crypto / hashers / sha2_hasher.h
1 /**
2 * @file sha2_hasher.h
3 *
4 * @brief Interface of sha2_hasher_t
5 *
6 */
7
8 /*
9 * Copyright (C) 2006 Martin Willi
10 * Hochschule fuer Technik Rapperswil
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * for more details.
21 */
22
23 #ifndef SHA2_HASHER_H_
24 #define SHA2_HASHER_H_
25
26 typedef struct sha2_hasher_t sha2_hasher_t;
27
28 #include <crypto/hashers/hasher.h>
29
30 /**
31 * @brief Implementation of hasher_t interface using the SHA2 algorithms.
32 *
33 * SHA2 is an other name for the SHA-256, SHA-384 and SHA-512 variants of
34 * the SHA hash algorithm.
35 *
36 * @b Constructors:
37 * - hasher_create() using HASH_SHA256, HASH_SHA384 or HASH_SHA512 as algorithm
38 * - sha2_hasher_create()
39 *
40 * @see hasher_t
41 *
42 * @ingroup hashers
43 */
44 struct sha2_hasher_t {
45
46 /**
47 * Generic hasher_t interface for this hasher.
48 */
49 hasher_t hasher_interface;
50 };
51
52 /**
53 * @brief Creates a new sha2_hasher_t.
54 *
55 * @param algorithm HASH_SHA256, HASH_SHA384 or HASH_SHA512
56 * @return sha2_hasher_t object
57 *
58 * @ingroup hashers
59 */
60 sha2_hasher_t *sha2_hasher_create(hash_algorithm_t algorithm);
61
62 #endif /* SHA2_HASHER_H_ */