Ruby 1.9.3p327(2012-11-10revision37606)
ext/digest/rmd160/rmd160.h
Go to the documentation of this file.
00001 /*      $NetBSD: rmd160.h,v 1.2 2000/07/07 10:47:06 ad Exp $    */
00002 /*      $RoughId: rmd160.h,v 1.3 2002/02/24 08:14:31 knu Exp $  */
00003 /*      $Id: rmd160.h 27437 2010-04-22 08:04:13Z nobu $ */
00004 
00005 /********************************************************************\
00006  *
00007  *      FILE:     rmd160.h
00008  *
00009  *      CONTENTS: Header file for a sample C-implementation of the
00010  *                RIPEMD-160 hash-function.
00011  *      TARGET:   any computer with an ANSI C compiler
00012  *
00013  *      AUTHOR:   Antoon Bosselaers, ESAT-COSIC
00014  *      DATE:     1 March 1996
00015  *      VERSION:  1.0
00016  *
00017  *      Copyright (c) Katholieke Universiteit Leuven
00018  *      1996, All Rights Reserved
00019  *
00020 \********************************************************************/
00021 
00022 /*
00023  * from OpenBSD: rmd160.h,v 1.4 1999/08/16 09:59:04 millert Exp
00024  */
00025 
00026 #ifndef _RMD160_H_
00027 #define _RMD160_H_
00028 
00029 #include "defs.h"
00030 
00031 typedef struct {
00032         uint32_t        state[5];       /* state (ABCDE) */
00033         uint32_t        length[2];      /* number of bits */
00034         uint8_t         bbuffer[64];    /* overflow buffer */
00035         uint32_t        buflen;         /* number of chars in bbuffer */
00036 } RMD160_CTX;
00037 
00038 #ifdef RUBY
00039 #define RMD160_Init     rb_Digest_RMD160_Init
00040 #define RMD160_Transform        rb_Digest_RMD160_Transform
00041 #define RMD160_Update   rb_Digest_RMD160_Update
00042 #define RMD160_Finish   rb_Digest_RMD160_Finish
00043 #endif
00044 
00045 __BEGIN_DECLS
00046 void    RMD160_Init _((RMD160_CTX *));
00047 void    RMD160_Transform _((uint32_t[5], const uint32_t[16]));
00048 void    RMD160_Update _((RMD160_CTX *, const uint8_t *, size_t));
00049 void    RMD160_Finish _((RMD160_CTX *, uint8_t[20]));
00050 __END_DECLS
00051 
00052 #define RMD160_BLOCK_LENGTH             64
00053 #define RMD160_DIGEST_LENGTH            20
00054 #define RMD160_DIGEST_STRING_LENGTH     (RMD160_DIGEST_LENGTH * 2 + 1)
00055 
00056 #endif  /* !_RMD160_H_ */
00057