1 /* hmac.h -- hashed message authentication codes
2 Copyright (C) 2005, 2009-2012 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3, or (at your option)
9 This program 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
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, see <http://www.gnu.org/licenses/>. */
17 /* Written by Simon Josefsson. */
24 /* Compute Hashed Message Authentication Code with MD5, as described
25 in RFC 2104, over BUFFER data of BUFLEN bytes using the KEY of
26 KEYLEN bytes, writing the output to pre-allocated 16 byte minimum
27 RESBUF buffer. Return 0 on success. */
29 hmac_md5 (const void *key
, size_t keylen
,
30 const void *buffer
, size_t buflen
, void *resbuf
);
32 /* Compute Hashed Message Authentication Code with SHA-1, over BUFFER
33 data of BUFLEN bytes using the KEY of KEYLEN bytes, writing the
34 output to pre-allocated 20 byte minimum RESBUF buffer. Return 0 on
37 hmac_sha1 (const void *key
, size_t keylen
,
38 const void *in
, size_t inlen
, void *resbuf
);