Skip to content

Commit d593ae8

Browse files
committed
sha1.c: use standard uint32_t.
1 parent c72253e commit d593ae8

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/sha1.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ A million repetitions of "a"
2323

2424
#include <stdio.h>
2525
#include <string.h>
26-
#include <sys/types.h> /* for u_int*_t */
26+
#include <stdint.h>
2727
#include "solarisfixes.h"
2828
#include "sha1.h"
2929
#include "config.h"
@@ -53,12 +53,12 @@ A million repetitions of "a"
5353

5454
/* Hash a single 512-bit block. This is the core of the algorithm. */
5555

56-
void SHA1Transform(u_int32_t state[5], const unsigned char buffer[64])
56+
void SHA1Transform(uint32_t state[5], const unsigned char buffer[64])
5757
{
58-
u_int32_t a, b, c, d, e;
58+
uint32_t a, b, c, d, e;
5959
typedef union {
6060
unsigned char c[64];
61-
u_int32_t l[16];
61+
uint32_t l[16];
6262
} CHAR64LONG16;
6363
#ifdef SHA1HANDSOFF
6464
CHAR64LONG16 block[1]; /* use array to appear as a pointer */
@@ -128,9 +128,9 @@ void SHA1Init(SHA1_CTX* context)
128128

129129
/* Run your data through this. */
130130

131-
void SHA1Update(SHA1_CTX* context, const unsigned char* data, u_int32_t len)
131+
void SHA1Update(SHA1_CTX* context, const unsigned char* data, uint32_t len)
132132
{
133-
u_int32_t i, j;
133+
uint32_t i, j;
134134

135135
j = context->count[0];
136136
if ((context->count[0] += len << 3) < j)
@@ -168,7 +168,7 @@ void SHA1Final(unsigned char digest[20], SHA1_CTX* context)
168168

169169
for (i = 0; i < 2; i++)
170170
{
171-
u_int32_t t = context->count[i];
171+
uint32_t t = context->count[i];
172172
int j;
173173

174174
for (j = 0; j < 4; t >>= 8, j++)

src/sha1.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ By Steve Reid <[email protected]>
66
*/
77

88
typedef struct {
9-
u_int32_t state[5];
10-
u_int32_t count[2];
9+
uint32_t state[5];
10+
uint32_t count[2];
1111
unsigned char buffer[64];
1212
} SHA1_CTX;
1313

14-
void SHA1Transform(u_int32_t state[5], const unsigned char buffer[64]);
14+
void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]);
1515
void SHA1Init(SHA1_CTX* context);
16-
void SHA1Update(SHA1_CTX* context, const unsigned char* data, u_int32_t len);
16+
void SHA1Update(SHA1_CTX* context, const unsigned char* data, uint32_t len);
1717
void SHA1Final(unsigned char digest[20], SHA1_CTX* context);

0 commit comments

Comments
 (0)