libdrizzle Developer Documentation

SHA-1 in C

Data Structures

struct  SHA1_CTX
 

Macros

#define SHA1_BLOCK_LENGTH   64
 
#define SHA1_DIGEST_LENGTH   20
 
#define SHA1_DIGEST_STRING_LENGTH   (SHA1_DIGEST_LENGTH * 2 + 1)
 

Functions

void SHA1Init (SHA1_CTX *)
 
void SHA1Pad (SHA1_CTX *)
 
void SHA1Transform (uint32_t[5], const uint8_t[SHA1_BLOCK_LENGTH])
 
void SHA1Update (SHA1_CTX *, const uint8_t *, size_t)
 
void SHA1Final (uint8_t[SHA1_DIGEST_LENGTH], SHA1_CTX *)
 

Detailed Description

By Steve Reid steve.nosp@m.@edm.nosp@m.web.c.nosp@m.om 100% Public Domain

Macro Definition Documentation

◆ SHA1_BLOCK_LENGTH

#define SHA1_BLOCK_LENGTH   64

Definition at line 20 of file sha1.h.

◆ SHA1_DIGEST_LENGTH

#define SHA1_DIGEST_LENGTH   20

Definition at line 21 of file sha1.h.

◆ SHA1_DIGEST_STRING_LENGTH

#define SHA1_DIGEST_STRING_LENGTH   (SHA1_DIGEST_LENGTH * 2 + 1)

Definition at line 22 of file sha1.h.

Function Documentation

◆ SHA1Init()

void SHA1Init ( SHA1_CTX * context)

Definition at line 116 of file sha1.c.

◆ SHA1Pad()

void SHA1Pad ( SHA1_CTX * context)

Definition at line 156 of file sha1.c.

◆ SHA1Transform()

void SHA1Transform ( uint32_t state[5],
const uint8_t buffer[SHA1_BLOCK_LENGTH] )

Definition at line 59 of file sha1.c.

◆ SHA1Update()

void SHA1Update ( SHA1_CTX * context,
const uint8_t * data,
size_t len )

Definition at line 133 of file sha1.c.

◆ SHA1Final()

void SHA1Final ( uint8_t digest[SHA1_DIGEST_LENGTH],
SHA1_CTX * context )

Definition at line 172 of file sha1.c.