hmacmd5.h revision 193149
1190631Skib/*
2190631Skib * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
3190631Skib * Copyright (C) 2000, 2001  Internet Software Consortium.
4190631Skib *
5190631Skib * Permission to use, copy, modify, and/or distribute this software for any
6190631Skib * purpose with or without fee is hereby granted, provided that the above
7190631Skib * copyright notice and this permission notice appear in all copies.
8190631Skib *
9190631Skib * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10190631Skib * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11190631Skib * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12190631Skib * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13190631Skib * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14190631Skib * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15190631Skib * PERFORMANCE OF THIS SOFTWARE.
16190631Skib */
17190631Skib
18190631Skib/* $Id: hmacmd5.h,v 1.12 2007/06/19 23:47:18 tbox Exp $ */
19190631Skib
20190631Skib/*! \file isc/hmacmd5.h
21190631Skib * \brief This is the header file for the HMAC-MD5 keyed hash algorithm
22190631Skib * described in RFC2104.
23190631Skib */
24190631Skib
25190631Skib#ifndef ISC_HMACMD5_H
26190631Skib#define ISC_HMACMD5_H 1
27190631Skib
28190631Skib#include <isc/lang.h>
29190631Skib#include <isc/md5.h>
30190631Skib#include <isc/types.h>
31190631Skib
32190631Skib#define ISC_HMACMD5_KEYLENGTH 64
33190631Skib
34190631Skibtypedef struct {
35190631Skib	isc_md5_t md5ctx;
36190631Skib	unsigned char key[ISC_HMACMD5_KEYLENGTH];
37190631Skib} isc_hmacmd5_t;
38190631Skib
39190631SkibISC_LANG_BEGINDECLS
40190631Skib
41190631Skibvoid
42190631Skibisc_hmacmd5_init(isc_hmacmd5_t *ctx, const unsigned char *key,
43190631Skib		 unsigned int len);
44190631Skib
45190631Skibvoid
46190631Skibisc_hmacmd5_invalidate(isc_hmacmd5_t *ctx);
47190631Skib
48190631Skibvoid
49190631Skibisc_hmacmd5_update(isc_hmacmd5_t *ctx, const unsigned char *buf,
50190631Skib		   unsigned int len);
51220238Skib
52220238Skibvoid
53220238Skibisc_hmacmd5_sign(isc_hmacmd5_t *ctx, unsigned char *digest);
54220238Skib
55220238Skibisc_boolean_t
56220238Skibisc_hmacmd5_verify(isc_hmacmd5_t *ctx, unsigned char *digest);
57220238Skib
58220238Skibisc_boolean_t
59220238Skibisc_hmacmd5_verify2(isc_hmacmd5_t *ctx, unsigned char *digest, size_t len);
60220238Skib
61220238SkibISC_LANG_ENDDECLS
62
63#endif /* ISC_HMACMD5_H */
64