Changeset 37689 in vbox for trunk/src/recompiler/tests/sha1.c
- Timestamp:
- Jun 29, 2011 4:01:23 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 72549
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler/tests/sha1.c
r37675 r37689 24 24 #include <stdio.h> 25 25 #include <string.h> 26 #include <s ys/types.h> /* for u_int*_t */26 #include <stdint.h> 27 27 28 28 /* ================ sha1.h ================ */ … … 34 34 35 35 typedef struct { 36 u _int32_t state[5];37 u _int32_t count[2];36 uint32_t state[5]; 37 uint32_t count[2]; 38 38 unsigned char buffer[64]; 39 39 } SHA1_CTX; 40 40 41 void SHA1Transform(u _int32_t state[5], const unsigned char buffer[64]);41 void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]); 42 42 void SHA1Init(SHA1_CTX* context); 43 void SHA1Update(SHA1_CTX* context, const unsigned char* data, u _int32_t len);43 void SHA1Update(SHA1_CTX* context, const unsigned char* data, uint32_t len); 44 44 void SHA1Final(unsigned char digest[20], SHA1_CTX* context); 45 45 /* ================ end of sha1.h ================ */ … … 71 71 /* Hash a single 512-bit block. This is the core of the algorithm. */ 72 72 73 void SHA1Transform(u _int32_t state[5], const unsigned char buffer[64])74 { 75 u _int32_t a, b, c, d, e;73 void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]) 74 { 75 uint32_t a, b, c, d, e; 76 76 typedef union { 77 77 unsigned char c[64]; 78 u _int32_t l[16];78 uint32_t l[16]; 79 79 } CHAR64LONG16; 80 80 #ifdef SHA1HANDSOFF … … 146 146 /* Run your data through this. */ 147 147 148 void SHA1Update(SHA1_CTX* context, const unsigned char* data, u _int32_t len)149 { 150 u _int32_t i;151 u _int32_t j;148 void SHA1Update(SHA1_CTX* context, const unsigned char* data, uint32_t len) 149 { 150 uint32_t i; 151 uint32_t j; 152 152 153 153 j = context->count[0]; … … 187 187 for (i = 0; i < 2; i++) 188 188 { 189 u _int32_t t = context->count[i];189 uint32_t t = context->count[i]; 190 190 int j; 191 191
Note:
See TracChangeset
for help on using the changeset viewer.