1*4ee48979Sagc /*	$NetBSD: rmd160.h,v 1.2 2016/06/14 20:47:08 agc Exp $	*/
22a988851Sagc /*	$KAME: rmd160.h,v 1.2 2003/07/25 09:37:55 itojun Exp $	*/
32a988851Sagc /*	$OpenBSD: rmd160.h,v 1.3 2002/03/14 01:26:51 millert Exp $	*/
42a988851Sagc /*
52a988851Sagc  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
62a988851Sagc  *
72a988851Sagc  * Redistribution and use in source and binary forms, with or without
82a988851Sagc  * modification, are permitted provided that the following conditions
92a988851Sagc  * are met:
102a988851Sagc  * 1. Redistributions of source code must retain the above copyright
112a988851Sagc  *    notice, this list of conditions and the following disclaimer.
122a988851Sagc  * 2. Redistributions in binary form must reproduce the above copyright
132a988851Sagc  *    notice, this list of conditions and the following disclaimer in the
142a988851Sagc  *    documentation and/or other materials provided with the distribution.
152a988851Sagc  *
162a988851Sagc  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
172a988851Sagc  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
182a988851Sagc  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
192a988851Sagc  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
202a988851Sagc  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
212a988851Sagc  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
222a988851Sagc  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
232a988851Sagc  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
242a988851Sagc  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
252a988851Sagc  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
262a988851Sagc  */
272a988851Sagc #ifndef  _RMD160_H
282a988851Sagc #define  _RMD160_H
292a988851Sagc 
302a988851Sagc #include <sys/types.h>
312a988851Sagc 
322a988851Sagc #include <inttypes.h>
332a988851Sagc 
342a988851Sagc #define RMD160_DIGEST_LENGTH		20
352a988851Sagc #define RMD160_DIGEST_STRING_LENGTH	41
362a988851Sagc 
37*4ee48979Sagc #ifndef __BEGIN_DECLS
38*4ee48979Sagc #  if defined(__cplusplus)
39*4ee48979Sagc #  define __BEGIN_DECLS           extern "C" {
40*4ee48979Sagc #  define __END_DECLS             }
41*4ee48979Sagc #  else
42*4ee48979Sagc #  define __BEGIN_DECLS
43*4ee48979Sagc #  define __END_DECLS
44*4ee48979Sagc #  endif
45*4ee48979Sagc #endif
46*4ee48979Sagc 
472a988851Sagc /* RMD160 context. */
482a988851Sagc typedef struct RMD160Context {
492a988851Sagc 	uint32_t state[5];	/* state */
502a988851Sagc 	uint64_t count;		/* number of bits, modulo 2^64 */
512a988851Sagc 	u_char buffer[64];	/* input buffer */
52*4ee48979Sagc } NETPGPV_RMD160_CTX;
532a988851Sagc 
542a988851Sagc __BEGIN_DECLS
55*4ee48979Sagc void	 netpgpv_RMD160Init(NETPGPV_RMD160_CTX *);
56*4ee48979Sagc void	 netpgpv_RMD160Transform(uint32_t [5], const u_char [64]);
57*4ee48979Sagc void	 netpgpv_RMD160Update(NETPGPV_RMD160_CTX *, const u_char *, uint32_t);
58*4ee48979Sagc void	 netpgpv_RMD160Final(u_char [RMD160_DIGEST_LENGTH], NETPGPV_RMD160_CTX *);
592a988851Sagc #ifndef _KERNEL
60*4ee48979Sagc char	*netpgpv_RMD160End(NETPGPV_RMD160_CTX *, char *);
61*4ee48979Sagc char	*netpgpv_RMD160FileChunk(const char *, char *, off_t, off_t);
62*4ee48979Sagc char	*netpgpv_RMD160File(const char *, char *);
63*4ee48979Sagc char	*netpgpv_RMD160Data(const u_char *, size_t, char *);
642a988851Sagc #endif /* _KERNEL */
652a988851Sagc __END_DECLS
662a988851Sagc 
672a988851Sagc #endif  /* _RMD160_H */
68