ext/digest/rmd160/rmd160.h


DEFINITIONS

This source file includes following functions.


   1  /*      $NetBSD: rmd160.h,v 1.2 2000/07/07 10:47:06 ad Exp $    */
   2  /*      $RoughId: rmd160.h,v 1.3 2002/02/24 08:14:31 knu Exp $  */
   3  /*      $Id: rmd160.h,v 1.2 2002/02/24 08:20:22 knu Exp $       */
   4  
   5  /********************************************************************\
   6   *
   7   *      FILE:     rmd160.h
   8   *
   9   *      CONTENTS: Header file for a sample C-implementation of the
  10   *                RIPEMD-160 hash-function. 
  11   *      TARGET:   any computer with an ANSI C compiler
  12   *
  13   *      AUTHOR:   Antoon Bosselaers, ESAT-COSIC
  14   *      DATE:     1 March 1996
  15   *      VERSION:  1.0
  16   *
  17   *      Copyright (c) Katholieke Universiteit Leuven
  18   *      1996, All Rights Reserved
  19   *
  20  \********************************************************************/
  21  
  22  /*
  23   * from OpenBSD: rmd160.h,v 1.4 1999/08/16 09:59:04 millert Exp
  24   */
  25  
  26  #ifndef _RMD160_H_
  27  #define _RMD160_H_
  28  
  29  #include "defs.h"
  30  
  31  typedef struct {
  32          uint32_t        state[5];       /* state (ABCDE) */
  33          uint32_t        length[2];      /* number of bits */
  34          uint8_t         bbuffer[64];    /* overflow buffer */
  35          uint32_t        buflen;         /* number of chars in bbuffer */
  36  } RMD160_CTX;
  37  
  38  #ifdef RUBY
  39  #define RMD160_Init     rb_Digest_RMD160_Init
  40  #define RMD160_Transform        rb_Digest_RMD160_Transform
  41  #define RMD160_Update   rb_Digest_RMD160_Update
  42  #define RMD160_Final    rb_Digest_RMD160_Final
  43  #define RMD160_Equal    rb_Digest_RMD160_Equal
  44  #ifndef _KERNEL
  45  #define RMD160_End      rb_Digest_RMD160_End
  46  #define RMD160_File     rb_Digest_RMD160_File
  47  #define RMD160_Data     rb_Digest_RMD160_Data
  48  #endif /* _KERNEL */
  49  #endif
  50  
  51  __BEGIN_DECLS
  52  void    RMD160_Init _((RMD160_CTX *));
  53  void    RMD160_Transform _((uint32_t[5], const uint32_t[16]));
  54  void    RMD160_Update _((RMD160_CTX *, const uint8_t *, size_t));
  55  void    RMD160_Final _((uint8_t[20], RMD160_CTX *));
  56  int     RMD160_Equal _((RMD160_CTX *, RMD160_CTX *));
  57  #ifndef _KERNEL
  58  char    *RMD160_End _((RMD160_CTX *, char *));
  59  char    *RMD160_File _((char *, char *));
  60  char    *RMD160_Data _((const uint8_t *, size_t, char *));
  61  #endif /* _KERNEL */
  62  __END_DECLS
  63  
  64  #define RMD160_BLOCK_LENGTH             64
  65  #define RMD160_DIGEST_LENGTH            20
  66  #define RMD160_DIGEST_STRING_LENGTH     (RMD160_DIGEST_LENGTH * 2 + 1)
  67  
  68  #endif  /* !_RMD160_H_ */