tin  2.4.5
About: TIN is a threaded NNTP and spool based UseNet newsreader.
  Fossies Dox: tin-2.4.5.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

sha1.c File Reference
#include "canlock-private.h"
#include "sha.h"
#include "sha-private.h"
Include dependency graph for sha1.c:

Go to the source code of this file.


#define SHA1_ROTL(bits, word)    (((word) << (bits)) | ((word) >> (32-(bits))))
#define SHA1AddLength(context, length)


static void SHA1ProcessMessageBlock (SHA1Context *context)
static void SHA1Finalize (SHA1Context *context, uint8_t Pad_Byte)
static void SHA1PadMessage (SHA1Context *context, uint8_t Pad_Byte)
int SHA1Reset (SHA1Context *context)
int SHA1Input (SHA1Context *context, const uint8_t *message_array, unsigned length)
int SHA1FinalBits (SHA1Context *context, uint8_t message_bits, unsigned int length)
int SHA1Result (SHA1Context *context, uint8_t Message_Digest[SHA1HashSize])


static uint32_t addTemp

Macro Definition Documentation


#define SHA1_ROTL (   bits,
)     (((word) << (bits)) | ((word) >> (32-(bits))))

Definition at line 46 of file sha1.c.

◆ SHA1AddLength

#define SHA1AddLength (   context,
(addTemp = (context)->Length_Low, \
(context)->Corrupted = \
(((context)->Length_Low += (length)) < addTemp) && \
(++(context)->Length_High == 0) ? shaInputTooLong \
: (context)->Corrupted )
static uint32_t addTemp
Definition: sha1.c:53
@ shaInputTooLong
Definition: sha.h:94
Definition: tin.h:107

Definition at line 54 of file sha1.c.

Function Documentation

◆ SHA1FinalBits()

int SHA1FinalBits ( SHA1Context context,
uint8_t  message_bits,
unsigned int  length 

Definition at line 163 of file sha1.c.

References SHA1AddLength, SHA1Finalize(), shaBadParam, shaNull, shaStateError, and shaSuccess.

Referenced by USHAFinalBits().

◆ SHA1Finalize()

static void SHA1Finalize ( SHA1Context context,
uint8_t  Pad_Byte 

Definition at line 346 of file sha1.c.

References SHA1_Message_Block_Size, and SHA1PadMessage().

Referenced by SHA1FinalBits(), and SHA1Result().

◆ SHA1Input()

int SHA1Input ( SHA1Context context,
const uint8_t *  message_array,
unsigned  length 

◆ SHA1PadMessage()

static void SHA1PadMessage ( SHA1Context context,
uint8_t  Pad_Byte 

Definition at line 382 of file sha1.c.

References SHA1_Message_Block_Size, and SHA1ProcessMessageBlock().

Referenced by SHA1Finalize().

◆ SHA1ProcessMessageBlock()

static void SHA1ProcessMessageBlock ( SHA1Context context)

Definition at line 251 of file sha1.c.

References cl_clear_secret(), SHA1_ROTL, SHA_Ch, SHA_Maj, and SHA_Parity.

Referenced by SHA1Input(), and SHA1PadMessage().

◆ SHA1Reset()

int SHA1Reset ( SHA1Context context)

Definition at line 81 of file sha1.c.

References shaNull, and shaSuccess.

Referenced by USHAReset().

◆ SHA1Result()

int SHA1Result ( SHA1Context context,
uint8_t  Message_Digest[SHA1HashSize] 

Definition at line 213 of file sha1.c.

References SHA1Finalize(), SHA1HashSize, shaNull, and shaSuccess.

Referenced by USHAResult().

Variable Documentation

◆ addTemp

uint32_t addTemp

Definition at line 53 of file sha1.c.