Skip to content

Commit

Permalink
replace 'SHA1_CTX' with 'struct Sha1Ctx'
Browse files Browse the repository at this point in the history
  • Loading branch information
flatcap committed May 16, 2017
1 parent fd13bfc commit b357e93
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pgppubring.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static struct PgpKeyInfo *pgp_parse_pgp2_key(unsigned char *buff, size_t l)
static void pgp_make_pgp3_fingerprint(unsigned char *buff, size_t l, unsigned char *digest)
{
unsigned char dummy;
SHA1_CTX context;
struct Sha1Ctx context;

SHA1_Init(&context);

Expand Down
6 changes: 3 additions & 3 deletions sha1.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void sha1_transform(uint32_t state[5], const unsigned char buffer[64])


/* sha1_init - Initialize new context */
void sha1_init(SHA1_CTX *context)
void sha1_init(struct Sha1Ctx *context)
{
/* SHA1 initialization constants */
context->state[0] = 0x67452301;
Expand All @@ -189,7 +189,7 @@ void sha1_init(SHA1_CTX *context)


/* Run your data through this. */
void sha1_update(SHA1_CTX *context, const unsigned char *data, uint32_t len)
void sha1_update(struct Sha1Ctx *context, const unsigned char *data, uint32_t len)
{
uint32_t i;
uint32_t j;
Expand All @@ -216,7 +216,7 @@ void sha1_update(SHA1_CTX *context, const unsigned char *data, uint32_t len)


/* Add padding and return the message digest. */
void sha1_final(unsigned char digest[20], SHA1_CTX *context)
void sha1_final(unsigned char digest[20], struct Sha1Ctx *context)
{
unsigned i;
unsigned char finalcount[8];
Expand Down
10 changes: 5 additions & 5 deletions sha1.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@

#include "crypthash.h"

typedef struct
struct Sha1Ctx
{
uint32_t state[5];
uint32_t count[2];
unsigned char buffer[64];
} SHA1_CTX;
};

void sha1_transform(uint32_t state[5], const unsigned char buffer[64]);
void sha1_init(SHA1_CTX *context);
void sha1_update(SHA1_CTX *context, const unsigned char *data, uint32_t len);
void sha1_final(unsigned char digest[20], SHA1_CTX *context);
void sha1_init(struct Sha1Ctx *context);
void sha1_update(struct Sha1Ctx *context, const unsigned char *data, uint32_t len);
void sha1_final(unsigned char digest[20], struct Sha1Ctx *context);

#define SHA1_Transform sha1_transform
#define SHA1_Init sha1_init
Expand Down

0 comments on commit b357e93

Please sign in to comment.