Add.
[shishi.git] / lib / crypto-md.c
blob40d1ac1169457b69c9a8c28e0beeeecaef72b06e
1 /* crypto-md.c --- DES crypto functions
2 * Copyright (C) 2002, 2003, 2004, 2007 Simon Josefsson
3 * Copyright (C) 2003 Free Software Foundation, Inc.
5 * This file is part of Shishi.
7 * Shishi is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
12 * Shishi is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Shishi; if not, see http://www.gnu.org/licenses or write
19 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
20 * Floor, Boston, MA 02110-1301, USA
24 #include "internal.h"
26 #include "crypto.h"
28 static int
29 md4_checksum (Shishi * handle,
30 Shishi_key * key,
31 int keyusage,
32 int cksumtype,
33 const char *in, size_t inlen, char **out, size_t * outlen)
35 if (outlen)
36 *outlen = 16;
37 return shishi_md4 (handle, in, inlen, out);
40 static int
41 md5_checksum (Shishi * handle,
42 Shishi_key * key,
43 int keyusage,
44 int cksumtype,
45 const char *in, size_t inlen, char **out, size_t * outlen)
47 if (outlen)
48 *outlen = 16;
49 return shishi_md5 (handle, in, inlen, out);
52 checksuminfo md4_info = {
53 SHISHI_RSA_MD4,
54 "rsa-md4",
55 16,
56 md4_checksum
59 checksuminfo md5_info = {
60 SHISHI_RSA_MD5,
61 "rsa-md5",
62 16,
63 md5_checksum