From: Jeroen Ruigrok/asmodai Date: Sat, 30 Aug 2003 15:21:57 +0000 (+0000) Subject: Add the RIPEMD-160 header file. X-Git-Tag: v2.0.1~13003 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/534bda7a313cea1ab34125a90e7000bfa2fb3b72 Add the RIPEMD-160 header file. Obtained from: OpenBSD-CURRENT --- diff --git a/include/Makefile b/include/Makefile index c21bbeb091..9c5395c374 100644 --- a/include/Makefile +++ b/include/Makefile @@ -1,6 +1,6 @@ # @(#)Makefile 8.2 (Berkeley) 1/4/94 # $FreeBSD: src/include/Makefile,v 1.109.2.27 2003/01/24 05:12:29 sam Exp $ -# $DragonFly: src/include/Makefile,v 1.7 2003/08/14 23:05:11 dillon Exp $ +# $DragonFly: src/include/Makefile,v 1.8 2003/08/30 15:21:57 asmodai Exp $ # # Doing a make install builds /usr/include # @@ -16,7 +16,8 @@ INCS= a.out.h ar.h assert.h bitstring.h complex.h ctype.h db.h \ langinfo.h libgen.h limits.h link.h locale.h malloc.h memory.h \ mpool.h ndbm.h netdb.h nl_types.h nlist.h objformat.h \ paths.h pthread.h pthread_np.h pwd.h \ - ranlib.h readpassphrase.h regex.h regexp.h resolv.h rune.h runetype.h \ + ranlib.h readpassphrase.h regex.h regexp.h resolv.h rmd160.h rune.h \ + runetype.h \ search.h setjmp.h sgtty.h \ signal.h stab.h stdbool.h stddef.h stdio.h stdlib.h \ string.h stringlist.h strings.h struct.h sysexits.h tar.h time.h \ diff --git a/include/rmd160.h b/include/rmd160.h new file mode 100644 index 0000000000..c843089950 --- /dev/null +++ b/include/rmd160.h @@ -0,0 +1,49 @@ +/* $DragonFly: src/include/rmd160.h,v 1.1 2003/08/30 15:21:57 asmodai Exp $ */ +/* $OpenBSD: rmd160.h,v 1.9 2003/06/26 19:34:17 avsm Exp $ */ +/* + * Copyright (c) 2001 Markus Friedl. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _RMD160_H +#define _RMD160_H + +/* RMD160 context. */ +typedef struct RMD160Context { + u_int32_t state[5]; /* state */ + u_int64_t count; /* number of bits, modulo 2^64 */ + u_char buffer[64]; /* input buffer */ +} RMD160_CTX; + +#include + +__BEGIN_DECLS +void RMD160Init(RMD160_CTX *); +void RMD160Transform(u_int32_t [5], const u_char [64]); +void RMD160Update(RMD160_CTX *, const u_char *, u_int32_t); +void RMD160Final(u_char [20], RMD160_CTX *); +char *RMD160End(RMD160_CTX *, char *); +char *RMD160File(char *, char *); +char *RMD160Data(const u_char *, size_t, char *) + __attribute__((__bounded__(__string__,3,2))); +__END_DECLS + +#endif /* _RMD160_H */