]>
Commit | Line | Data |
---|---|---|
f27f6296 | 1 | /* |
552cc11b | 2 | * Copyright (C) 2006-2008 Martin Willi |
19ef2aec TB |
3 | * |
4 | * Copyright (C) secunet Security Networks AG | |
f27f6296 MW |
5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | |
7 | * under the terms of the GNU General Public License as published by the | |
8 | * Free Software Foundation; either version 2 of the License, or (at your | |
9 | * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, but | |
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | * for more details. | |
15 | */ | |
16 | ||
552cc11b MW |
17 | /** |
18 | * @defgroup fips_prf fips_prf | |
19 | * @{ @ingroup fips_prf_p | |
20 | */ | |
21 | ||
f27f6296 MW |
22 | #ifndef FIPS_PRF_H_ |
23 | #define FIPS_PRF_H_ | |
24 | ||
25 | typedef struct fips_prf_t fips_prf_t; | |
26 | ||
27 | #include <library.h> | |
28 | #include <crypto/prfs/prf.h> | |
29 | #include <crypto/hashers/hasher.h> | |
30 | ||
31 | /** | |
552cc11b | 32 | * Implementation of prf_t using the FIPS 186-2-change1 standard. |
f27f6296 MW |
33 | * |
34 | * FIPS defines a "General Purpose Random Number Generator" (Revised | |
35 | * Algorithm for Computing m values of x (Appendix 3.1 of FIPS 186-2)). This | |
36 | * implementation is not intended for private key generation and therefore does | |
37 | * not include the "mod q" operation (see FIPS 186-2-change1 p74). | |
38 | * The FIPS PRF is stateful; the key changes every time when bytes are acquired. | |
f27f6296 MW |
39 | */ |
40 | struct fips_prf_t { | |
7daf5226 | 41 | |
f27f6296 MW |
42 | /** |
43 | * Generic prf_t interface for this fips_prf_t class. | |
44 | */ | |
45 | prf_t prf_interface; | |
46 | }; | |
47 | ||
48 | /** | |
552cc11b | 49 | * Creates a new fips_prf_t object. |
7daf5226 | 50 | * |
f27f6296 MW |
51 | * FIPS 186-2 defines G() functions used in the PRF function. It can |
52 | * be implemented either based on SHA1 or DES. | |
552cc11b | 53 | * The G() function is selected using the algo parameter. |
f27f6296 | 54 | * |
552cc11b MW |
55 | * @param algo specific FIPS PRF implementation, specifies G() function |
56 | * @return fips_prf_t object, NULL if not supported. | |
f27f6296 | 57 | */ |
552cc11b | 58 | fips_prf_t *fips_prf_create(pseudo_random_function_t algo); |
f27f6296 | 59 | |
1490ff4d | 60 | #endif /** FIPS_PRF_H_ @}*/ |