/[rdesktop]/sourceforge.net/trunk/rdesktop/crypto/sha.h
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/crypto/sha.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 31 by matty, Tue Aug 15 10:32:09 2000 UTC revision 32 by matty, Sat Sep 15 09:37:17 2001 UTC
# Line 1  Line 1 
1  /* crypto/sha/sha.h */  /* crypto/sha/sha.h */
2  /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)  /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3   * All rights reserved.   * All rights reserved.
4   *   *
5   * This package is an SSL implementation written   * This package is an SSL implementation written
# Line 63  Line 63 
63  extern "C" {  extern "C" {
64  #endif  #endif
65    
66  #define SHA_CBLOCK      64  #if defined(NO_SHA) || (defined(NO_SHA0) && defined(NO_SHA1))
67    #error SHA is disabled.
68    #endif
69    
70    /*
71     * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
72     * ! SHA_LONG has to be at least 32 bits wide. If it's wider, then !
73     * ! SHA_LONG_LOG2 has to be defined along.                        !
74     * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
75     */
76    
77    #if defined(WIN16) || defined(__LP32__)
78    #define SHA_LONG unsigned long
79    #elif defined(_CRAY) || defined(__ILP64__)
80    #define SHA_LONG unsigned long
81    #define SHA_LONG_LOG2 3
82    #else
83    #define SHA_LONG unsigned int
84    #endif
85    
86  #define SHA_LBLOCK      16  #define SHA_LBLOCK      16
87  #define SHA_BLOCK       16  #define SHA_CBLOCK      (SHA_LBLOCK*4)  /* SHA treats input data as a
88  #define SHA_LAST_BLOCK  56                                           * contiguous array of 32 bit
89  #define SHA_LENGTH_BLOCK 8                                           * wide big-endian values. */
90    #define SHA_LAST_BLOCK  (SHA_CBLOCK-8)
91  #define SHA_DIGEST_LENGTH 20  #define SHA_DIGEST_LENGTH 20
92    
93  typedef struct SHAstate_st  typedef struct SHAstate_st
94          {          {
95          unsigned long h0,h1,h2,h3,h4;          SHA_LONG h0,h1,h2,h3,h4;
96          unsigned long Nl,Nh;          SHA_LONG Nl,Nh;
97          unsigned long data[SHA_LBLOCK];          SHA_LONG data[SHA_LBLOCK];
98          int num;          int num;
99          } SHA_CTX;          } SHA_CTX;
100    
101  #ifndef NOPROTO  #ifndef NO_SHA0
102  void SHA_Init(SHA_CTX *c);  void SHA_Init(SHA_CTX *c);
103  void SHA_Update(SHA_CTX *c, unsigned char *data, unsigned long len);  void SHA_Update(SHA_CTX *c, const void *data, unsigned long len);
104  void SHA_Final(unsigned char *md, SHA_CTX *c);  void SHA_Final(unsigned char *md, SHA_CTX *c);
105  unsigned char *SHA(unsigned char *d, unsigned long n,unsigned char *md);  unsigned char *SHA(const unsigned char *d, unsigned long n,unsigned char *md);
106  void SHA_Transform(SHA_CTX *c, unsigned char *data);  void SHA_Transform(SHA_CTX *c, const unsigned char *data);
107    #endif
108    #ifndef NO_SHA1
109  void SHA1_Init(SHA_CTX *c);  void SHA1_Init(SHA_CTX *c);
110  void SHA1_Update(SHA_CTX *c, unsigned char *data, unsigned long len);  void SHA1_Update(SHA_CTX *c, const void *data, unsigned long len);
111  void SHA1_Final(unsigned char *md, SHA_CTX *c);  void SHA1_Final(unsigned char *md, SHA_CTX *c);
112  unsigned char *SHA1(unsigned char *d, unsigned long n,unsigned char *md);  unsigned char *SHA1(const unsigned char *d, unsigned long n,unsigned char *md);
113  void SHA1_Transform(SHA_CTX *c, unsigned char *data);  void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
 #else  
 void SHA_Init();  
 void SHA_Update();  
 void SHA_Final();  
 unsigned char *SHA();  
 void SHA_Transform();  
 void SHA1_Init();  
 void SHA1_Update();  
 void SHA1_Final();  
 unsigned char *SHA1();  
 void SHA1_Transform();  
114  #endif  #endif
   
115  #ifdef  __cplusplus  #ifdef  __cplusplus
116  }  }
117  #endif  #endif

Legend:
Removed from v.31  
changed lines
  Added in v.32

  ViewVC Help
Powered by ViewVC 1.1.26