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