144301Swollman/* crypto/ripemd/ripemd.h */
244301Swollman/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
344301Swollman * All rights reserved.
444301Swollman *
544301Swollman * This package is an SSL implementation written
644301Swollman * by Eric Young (eay@cryptsoft.com).
744301Swollman * The implementation was written so as to conform with Netscapes SSL.
844301Swollman *
944301Swollman * This library is free for commercial and non-commercial use as long as
1044301Swollman * the following conditions are aheared to.  The following conditions
1144301Swollman * apply to all code found in this distribution, be it the RC4, RSA,
1244301Swollman * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
1344301Swollman * included with this distribution is covered by the same copyright terms
1444301Swollman * except that the holder is Tim Hudson (tjh@cryptsoft.com).
1544301Swollman *
1644301Swollman * Copyright remains Eric Young's, and as such any Copyright notices in
1744301Swollman * the code are not to be removed.
1844301Swollman * If this package is used in a product, Eric Young should be given attribution
1944301Swollman * as the author of the parts of the library used.
2044301Swollman * This can be in the form of a textual message at program startup or
2144301Swollman * in documentation (online or textual) provided with the package.
2244301Swollman *
2344301Swollman * Redistribution and use in source and binary forms, with or without
2444301Swollman * modification, are permitted provided that the following conditions
2544301Swollman * are met:
2644301Swollman * 1. Redistributions of source code must retain the copyright
2744301Swollman *    notice, this list of conditions and the following disclaimer.
2844301Swollman * 2. Redistributions in binary form must reproduce the above copyright
2944301Swollman *    notice, this list of conditions and the following disclaimer in the
3044301Swollman *    documentation and/or other materials provided with the distribution.
3144301Swollman * 3. All advertising materials mentioning features or use of this software
3244301Swollman *    must display the following acknowledgement:
3344301Swollman *    "This product includes cryptographic software written by
3444301Swollman *     Eric Young (eay@cryptsoft.com)"
3544301Swollman *    The word 'cryptographic' can be left out if the rouines from the library
3644301Swollman *    being used are not cryptographic related :-).
3744301Swollman * 4. If you include any Windows specific code (or a derivative thereof) from
3844301Swollman *    the apps directory (application code) you must include an acknowledgement:
3944301Swollman *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
4044301Swollman *
4144301Swollman * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
4244301Swollman * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4344301Swollman * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
4444301Swollman * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
4544301Swollman * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
4644301Swollman * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
4744301Swollman * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
4844301Swollman * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
4944301Swollman * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
5044301Swollman * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
5144301Swollman * SUCH DAMAGE.
5244301Swollman *
5344301Swollman * The licence and distribution terms for any publically available version or
5444301Swollman * derivative of this code cannot be changed.  i.e. this code cannot simply be
5544301Swollman * copied and put under another distribution licence
5644301Swollman * [including the GNU Public Licence.]
5744301Swollman */
5844301Swollman
5974385Sphk/*
6074385Sphk * $FreeBSD$
6174385Sphk */
6274385Sphk
6344301Swollman#ifndef HEADER_RIPEMD_H
6444301Swollman#define HEADER_RIPEMD_H
6544301Swollman
6644301Swollman#include <sys/cdefs.h>
6744301Swollman#include <sys/types.h>		/* XXX switch to machine/ansi.h and __ types */
6844301Swollman
6944301Swollman#define RIPEMD160_CBLOCK	64
7044301Swollman#define RIPEMD160_LBLOCK	16
7144301Swollman#define RIPEMD160_BLOCK		16
7244301Swollman#define RIPEMD160_LAST_BLOCK	56
7344301Swollman#define RIPEMD160_LENGTH_BLOCK	8
7444301Swollman#define RIPEMD160_DIGEST_LENGTH	20
7544301Swollman
7644301Swollmantypedef struct RIPEMD160state_st {
7744301Swollman	u_int32_t A,B,C,D,E;
7844301Swollman	u_int32_t Nl,Nh;
7944301Swollman	u_int32_t data[RIPEMD160_LBLOCK];
8044301Swollman	int num;
8144301Swollman} RIPEMD160_CTX;
8244301Swollman
8344301Swollman__BEGIN_DECLS
8444301Swollmanvoid	RIPEMD160_Init(RIPEMD160_CTX *c);
85154479Sphkvoid	RIPEMD160_Update(RIPEMD160_CTX *c, const void *data,
8644301Swollman			 size_t len);
8744301Swollmanvoid	RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
8844301Swollmanchar   *RIPEMD160_End(RIPEMD160_CTX *, char *);
8944301Swollmanchar   *RIPEMD160_File(const char *, char *);
9074385Sphkchar   *RIPEMD160_FileChunk(const char *, char *, off_t, off_t);
91154479Sphkchar   *RIPEMD160_Data(const void *, unsigned int, char *);
9244301Swollman__END_DECLS
9344301Swollman
9444301Swollman#endif
95