10SN/A/* crypto/ripemd/ripemd.h */ 27578SN/A/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 30SN/A * All rights reserved. 40SN/A * 50SN/A * This package is an SSL implementation written 60SN/A * by Eric Young (eay@cryptsoft.com). 72362SN/A * The implementation was written so as to conform with Netscapes SSL. 80SN/A * 92362SN/A * This library is free for commercial and non-commercial use as long as 100SN/A * the following conditions are aheared to. The following conditions 110SN/A * apply to all code found in this distribution, be it the RC4, RSA, 120SN/A * lhash, DES, etc., code; not just the SSL code. The SSL documentation 130SN/A * included with this distribution is covered by the same copyright terms 140SN/A * except that the holder is Tim Hudson (tjh@cryptsoft.com). 150SN/A * 160SN/A * Copyright remains Eric Young's, and as such any Copyright notices in 170SN/A * the code are not to be removed. 180SN/A * If this package is used in a product, Eric Young should be given attribution 190SN/A * as the author of the parts of the library used. 200SN/A * This can be in the form of a textual message at program startup or 212362SN/A * in documentation (online or textual) provided with the package. 222362SN/A * 232362SN/A * Redistribution and use in source and binary forms, with or without 240SN/A * modification, are permitted provided that the following conditions 250SN/A * are met: 260SN/A * 1. Redistributions of source code must retain the copyright 270SN/A * notice, this list of conditions and the following disclaimer. 280SN/A * 2. Redistributions in binary form must reproduce the above copyright 290SN/A * notice, this list of conditions and the following disclaimer in the 300SN/A * documentation and/or other materials provided with the distribution. 310SN/A * 3. All advertising materials mentioning features or use of this software 320SN/A * must display the following acknowledgement: 330SN/A * "This product includes cryptographic software written by 340SN/A * Eric Young (eay@cryptsoft.com)" 350SN/A * The word 'cryptographic' can be left out if the routines from the library 360SN/A * being used are not cryptographic related :-). 370SN/A * 4. If you include any Windows specific code (or a derivative thereof) from 380SN/A * the apps directory (application code) you must include an acknowledgement: 390SN/A * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 402395SN/A * 410SN/A * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 420SN/A * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 430SN/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 440SN/A * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 450SN/A * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 460SN/A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 470SN/A * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 480SN/A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 490SN/A * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 500SN/A * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 510SN/A * SUCH DAMAGE. 520SN/A * 530SN/A * The licence and distribution terms for any publically available version or 547578SN/A * derivative of this code cannot be changed. i.e. this code cannot simply be 550SN/A * copied and put under another distribution licence 560SN/A * [including the GNU Public Licence.] 570SN/A */ 580SN/A 590SN/A/* 600SN/A */ 610SN/A 620SN/A#ifndef HEADER_RIPEMD_H 630SN/A#define HEADER_RIPEMD_H 640SN/A 650SN/A#include <sys/types.h> /* XXX switch to machine/ansi.h and __ types */ 660SN/A 670SN/A#define RIPEMD160_CBLOCK 64 6812515Savstepan#define RIPEMD160_LBLOCK 16 690SN/A#define RIPEMD160_BLOCK 16 700SN/A#define RIPEMD160_LAST_BLOCK 56 710SN/A#define RIPEMD160_LENGTH_BLOCK 8 720SN/A#define RIPEMD160_DIGEST_LENGTH 20 730SN/A 740SN/Atypedef struct RIPEMD160state_st { 750SN/A u_int32_t A,B,C,D,E; 760SN/A u_int32_t Nl,Nh; 770SN/A u_int32_t data[RIPEMD160_LBLOCK]; 780SN/A int num; 790SN/A} RIPEMD160_CTX; 800SN/A 810SN/A__BEGIN_DECLS 820SN/A 8312515Savstepan/* Ensure libmd symbols do not clash with libcrypto */ 840SN/A 8512515Savstepan#ifndef RIPEMD160_Init 860SN/A#define RIPEMD160_Init _libmd_RIPEMD160_Init 870SN/A#endif 880SN/A#ifndef RIPEMD160_Update 890SN/A#define RIPEMD160_Update _libmd_RIPEMD160_Update 9012515Savstepan#endif 910SN/A#ifndef RIPEMD160_Final 920SN/A#define RIPEMD160_Final _libmd_RIPEMD160_Final 930SN/A#endif 940SN/A#ifndef RIPEMD160_End 950SN/A#define RIPEMD160_End _libmd_RIPEMD160_End 960SN/A#endif 970SN/A#ifndef RIPEMD160_Fd 980SN/A#define RIPEMD160_Fd _libmd_RIPEMD160_Fd 990SN/A#endif 1000SN/A#ifndef RIPEMD160_FdChunk 1010SN/A#define RIPEMD160_FdChunk _libmd_RIPEMD160_FdChunk 1020SN/A#endif 10312515Savstepan#ifndef RIPEMD160_File 1040SN/A#define RIPEMD160_File _libmd_RIPEMD160_File 10512515Savstepan#endif 1060SN/A#ifndef RIPEMD160_FileChunk 1070SN/A#define RIPEMD160_FileChunk _libmd_RIPEMD160_FileChunk 1080SN/A#endif 1090SN/A#ifndef RIPEMD160_Data 11012515Savstepan#define RIPEMD160_Data _libmd_RIPEMD160_Data 1110SN/A#endif 1120SN/A 1130SN/A#ifndef RIPEMD160_Transform 1140SN/A#define RIPEMD160_Transform _libmd_RIPEMD160_Transform 11513901Salanb#endif 11613901Salanb#ifndef RMD160_version 11713901Salanb#define RMD160_version _libmd_RMD160_version 11813901Salanb#endif 11913901Salanb#ifndef ripemd160_block 1209675SN/A#define ripemd160_block _libmd_ripemd160_block 1210SN/A#endif 1220SN/A 1230SN/Avoid RIPEMD160_Init(RIPEMD160_CTX *c); 1240SN/Avoid RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, 12512515Savstepan size_t len); 12612515Savstepanvoid RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); 12712515Savstepanchar *RIPEMD160_End(RIPEMD160_CTX *, char *); 1280SN/Achar *RIPEMD160_Fd(int, char *); 1290SN/Achar *RIPEMD160_FdChunk(int, char *, off_t, off_t); 1300SN/Achar *RIPEMD160_File(const char *, char *); 1310SN/Achar *RIPEMD160_FileChunk(const char *, char *, off_t, off_t); 1320SN/Achar *RIPEMD160_Data(const void *, unsigned int, char *); 1330SN/A__END_DECLS 1340SN/A 13512515Savstepan#endif 1360SN/A