*** empty log message ***
[shishi.git] / lib / pkcs5.h
blobbfaf507d74f1839b0ba944aaa73fd4d1a0611572
1 /* pkcs5.h header file for pkcs5 functions -*- c -*-
2 * Copyright (C) 2002 Simon Josefsson
4 * This file is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This file is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this file; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #ifndef PKCS5_H
21 #define PKCS5_H
23 #include <stddef.h>
25 /* PRF types */
26 enum
28 /* XXX must be synchronized with libgcrypt */
29 PKCS5_PRF_MD5 = 1,
30 PKCS5_PRF_SHA1 = 2,
31 PKCS5_PRF_RMD160 = 3,
32 PKCS5_PRF_MD2 = 5,
33 PKCS5_PRF_TIGER = 6,
34 PKCS5_PRF_HAVAL = 7,
35 PKCS5_PRF_SHA256 = 8,
36 PKCS5_PRF_SHA384 = 9,
37 PKCS5_PRF_SHA512 = 10,
38 PKCS5_PRF_MD4 = 11
41 /* Error codes */
42 enum
44 PKCS5_OK = 0,
45 PKCS5_INVALID_PRF,
46 PKCS5_INVALID_ITERATION_COUNT,
47 PKCS5_INVALID_DERIVED_KEY_LENGTH,
48 PKCS5_DERIVED_KEY_TOO_LONG
51 extern int
52 PBKDF2 (int PRF,
53 const char *P,
54 size_t Plen,
55 const char *S,
56 size_t Slen, unsigned int c, unsigned int dkLen, char *DK);
58 #endif /* PKCS5_H */