summaryrefslogtreecommitdiff
path: root/lib/hmac.h (plain)
blob: 388ab68a5cf8a329112b9cc60357012a27054fd7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* hmac.h
 *
 * Copyright (C) 2009 Tillmann Werner <tillmann.werner@gmx.de>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License Version 2 as
 * published by the Free Software Foundation.  You may not use, modify or
 * distribute this program under any other version of the GNU General
 * Public License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * This code is based on an OpenSSL-compatible implementation of the RSA
 * Data Security, * Inc. MD5 Message-Digest Algorithm, written by Solar
 * Designer <solar at openwall.com> in 2001, and placed in the public
 * domain. There's absolutely no warranty.
 *
 * This implementation is meant to be fast, but not as fast as possible.
 * Some known optimizations are not included to reduce source code size
 * and avoid compile-time configuration.
 *
 *
 * $Id$
 */

#ifndef __NEBULA_HMAC_H
#define __NEBULA_HMAC_H

#if HAVE_CONFIG_H
# include <config.h>
#endif

#define HMAC_BLOCK_SIZE 256
#define HMAC_HASH_SIZE  128
#define IPAD_VAL        0x36
#define OPAD_VAL        0x5C

char *hmac(const u_char *ipad, const u_char *opad, u_char **msg, ssize_t len);

#endif