xref: /freebsd/sys/opencrypto/rmd160.h (revision d3d79e968b67cc9a9855f9a29cf72763dec3578d)
1091d81d1SSam Leffler /*	$FreeBSD$	*/
2091d81d1SSam Leffler /*	$OpenBSD: rmd160.h,v 1.3 2002/03/14 01:26:51 millert Exp $	*/
360727d8bSWarner Losh /*-
4091d81d1SSam Leffler  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
5091d81d1SSam Leffler  *
6091d81d1SSam Leffler  * Redistribution and use in source and binary forms, with or without
7091d81d1SSam Leffler  * modification, are permitted provided that the following conditions
8091d81d1SSam Leffler  * are met:
9091d81d1SSam Leffler  * 1. Redistributions of source code must retain the above copyright
10091d81d1SSam Leffler  *    notice, this list of conditions and the following disclaimer.
11091d81d1SSam Leffler  * 2. Redistributions in binary form must reproduce the above copyright
12091d81d1SSam Leffler  *    notice, this list of conditions and the following disclaimer in the
13091d81d1SSam Leffler  *    documentation and/or other materials provided with the distribution.
14091d81d1SSam Leffler  *
15091d81d1SSam Leffler  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16091d81d1SSam Leffler  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17091d81d1SSam Leffler  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18091d81d1SSam Leffler  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19091d81d1SSam Leffler  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20091d81d1SSam Leffler  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21091d81d1SSam Leffler  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22091d81d1SSam Leffler  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23091d81d1SSam Leffler  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24091d81d1SSam Leffler  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25091d81d1SSam Leffler  */
26091d81d1SSam Leffler #ifndef  _RMD160_H
27091d81d1SSam Leffler #define  _RMD160_H
28091d81d1SSam Leffler 
29091d81d1SSam Leffler /* RMD160 context. */
30091d81d1SSam Leffler typedef struct RMD160Context {
31*d3d79e96SJohn Baldwin 	uint32_t state[5];	/* state */
32*d3d79e96SJohn Baldwin 	uint64_t count;	/* number of bits, modulo 2^64 */
33091d81d1SSam Leffler 	u_char buffer[64];	/* input buffer */
34091d81d1SSam Leffler } RMD160_CTX;
35091d81d1SSam Leffler 
36091d81d1SSam Leffler void	 RMD160Init(RMD160_CTX *);
37*d3d79e96SJohn Baldwin void	 RMD160Transform(uint32_t [5], const u_char [64]);
38*d3d79e96SJohn Baldwin void	 RMD160Update(RMD160_CTX *, const u_char *, uint32_t);
39091d81d1SSam Leffler void	 RMD160Final(u_char [20], RMD160_CTX *);
40091d81d1SSam Leffler 
41091d81d1SSam Leffler #endif  /* _RMD160_H */
42