|
xorp
|
00001 /* 00002 * vim:set sts=4 ts=8: 00003 * 00004 * FILE: hmac.h 00005 * AUTHORS: Colin Perkins 00006 * 00007 * HMAC message authentication (RFC2104) 00008 * 00009 * Copyright (c) 1998-2000 University College London 00010 * All rights reserved. 00011 * 00012 * Redistribution and use in source and binary forms, with or without 00013 * modification, is permitted provided that the following conditions 00014 * are met: 00015 * 1. Redistributions of source code must retain the above copyright 00016 * notice, this list of conditions and the following disclaimer. 00017 * 2. Redistributions in binary form must reproduce the above copyright 00018 * notice, this list of conditions and the following disclaimer in the 00019 * documentation and/or other materials provided with the distribution. 00020 * 3. All advertising materials mentioning features or use of this software 00021 * must display the following acknowledgement: 00022 * This product includes software developed by the Computer Science 00023 * Department at University College London 00024 * 4. Neither the name of the University nor of the Department may be used 00025 * to endorse or promote products derived from this software without 00026 * specific prior written permission. 00027 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 00028 * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00029 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00030 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 00031 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00032 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00033 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00034 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00035 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00036 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00037 * SUCH DAMAGE. 00038 */ 00039 00040 #ifdef __cplusplus 00041 extern "C" { 00042 #endif 00043 00053 void hmac_md5(const unsigned char *data, int data_bytes, 00054 const unsigned char *key, int key_bytes, 00055 unsigned char digest[16]); 00056 00067 const char* hmac_md5_digest_to_ascii(unsigned char digest[16], 00068 char* b, unsigned int b_bytes); 00069 00070 #ifdef __cplusplus 00071 } 00072 #endif