9a9df501fda6bcde420c689c52a73f6784791b12
[strongswan.git] / Source / charon / transforms / hashers / hasher_sha1.c
1 /**
2 * @file hasher_sha1.c
3 *
4 * @brief Implementation of hasher_t interface using the
5 * SHA1 algorithm.
6 *
7 */
8
9 /*
10 * Copyright (C) 2005 Jan Hutter, Martin Willi
11 * Hochschule fuer Technik Rapperswil
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 *
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
22 */
23
24 #include "hasher_sha1.h"
25
26 #include "../../utils/allocator.h"
27
28 typedef struct private_hasher_sha1_s private_hasher_sha1_t;
29
30 struct private_hasher_sha1_s {
31 /**
32 * public interface for this hasher
33 */
34 hasher_sha1_t public;
35 };
36
37
38
39
40
41 /*
42 * Described in header
43 */
44 hasher_sha1_t *hasher_sha1_create()
45 {
46 private_hasher_sha1_t *this = allocator_alloc_thing(private_hasher_sha1_t);
47
48 if (this == NULL)
49 {
50 return NULL;
51 }
52
53 return &(this->public);
54 }
55
56
57
58
59