sha1.h revision 7b8ec0341c3b3b1bfcfd20694b0a6ed590ea2c1c
76b43e4417bab52e913da39b5f5bc2a130d3f149Timo Sirainen/* $FreeBSD: src/sys/crypto/sha1.h,v 1.8 2002/03/20 05:13:50 alfred Exp $ */
df02611c44e9432e7961223bf9bfa3fb233b1789Timo Sirainen/* $KAME: sha1.h,v 1.5 2000/03/27 04:36:23 sumikawa Exp $ */
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
df02611c44e9432e7961223bf9bfa3fb233b1789Timo Sirainen * All rights reserved.
df02611c44e9432e7961223bf9bfa3fb233b1789Timo Sirainen * Redistribution and use in source and binary forms, with or without
b039dabf4c53f72454e795930e7643b6e0e625f9Timo Sirainen * modification, are permitted provided that the following conditions
df02611c44e9432e7961223bf9bfa3fb233b1789Timo Sirainen * 1. Redistributions of source code must retain the above copyright
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen * notice, this list of conditions and the following disclaimer.
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen * 2. Redistributions in binary form must reproduce the above copyright
df02611c44e9432e7961223bf9bfa3fb233b1789Timo Sirainen * notice, this list of conditions and the following disclaimer in the
39afc7584d935b2dc7332c21966a7b20da03f1ecTimo Sirainen * documentation and/or other materials provided with the distribution.
df02611c44e9432e7961223bf9bfa3fb233b1789Timo Sirainen * 3. Neither the name of the project nor the names of its contributors
df02611c44e9432e7961223bf9bfa3fb233b1789Timo Sirainen * may be used to endorse or promote products derived from this software
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen * without specific prior written permission.
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
b039dabf4c53f72454e795930e7643b6e0e625f9Timo Sirainen * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
df02611c44e9432e7961223bf9bfa3fb233b1789Timo Sirainen * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3320f4770d1f6c2cdd10f3c4ca5a324beb335339Timo Sirainen * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39afc7584d935b2dc7332c21966a7b20da03f1ecTimo Sirainen * SUCH DAMAGE.
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen * FIPS pub 180-1: Secure Hash Algorithm (SHA-1)
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen * based on: http://csrc.nist.gov/fips/fip180-1.txt
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen * implemented by Jun-ichiro itojun Itoh <itojun@itojun.org>
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen/* libmysqlclient really should try to keep its internal stuff internal so
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen they won't conflict with the actual programs that are trying to use it.
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen This particular instance has been fixed in 4.1.18 and 5.0.19, but there
82b990b0bb2a1dad5c2634a508a5ad87715db402Timo Sirainen are others. */
3320f4770d1f6c2cdd10f3c4ca5a324beb335339Timo Sirainen#define sha1_result sha1_result_libmysqlclient_craps_all_over
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainenextern void sha1_loop(struct sha1_ctxt *, const void *, size_t);
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainenextern void sha1_result(struct sha1_ctxt *, void *);
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen/* compatibilty with other SHA1 source codes */
3320f4770d1f6c2cdd10f3c4ca5a324beb335339Timo Sirainen#define SHA1Update(x, y, z) sha1_loop((x), (y), (z))
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainenextern void sha1_get_digest(const void *, size_t,
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen unsigned char [SHA1_RESULTLEN]);
cb1fd563e6000153d1be76fd8722a096bd144b77Timo Sirainen#endif /*__SHA1_H*/