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)  

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

Go to the source code of this file.

Macros

#define SHA512_SHR(bits, word)   (((uint64_t)(word)) >> (bits))
 
#define SHA512_ROTR(bits, word)
 
#define SHA512_SIGMA0(word)    (SHA512_ROTR(28,word) ^ SHA512_ROTR(34,word) ^ SHA512_ROTR(39,word))
 
#define SHA512_SIGMA1(word)    (SHA512_ROTR(14,word) ^ SHA512_ROTR(18,word) ^ SHA512_ROTR(41,word))
 
#define SHA512_sigma0(word)    (SHA512_ROTR( 1,word) ^ SHA512_ROTR( 8,word) ^ SHA512_SHR( 7,word))
 
#define SHA512_sigma1(word)    (SHA512_ROTR(19,word) ^ SHA512_ROTR(61,word) ^ SHA512_SHR( 6,word))
 
#define SHA384_512AddLength(context, length)
 

Functions

static int SHA384_512Reset (SHA512Context *context, uint64_t H0[SHA512HashSize/8])
 
static void SHA384_512ProcessMessageBlock (SHA512Context *context)
 
static void SHA384_512Finalize (SHA512Context *context, uint8_t Pad_Byte)
 
static void SHA384_512PadMessage (SHA512Context *context, uint8_t Pad_Byte)
 
static int SHA384_512ResultN (SHA512Context *context, uint8_t Message_Digest[], int HashSize)
 
int SHA384Reset (SHA384Context *context)
 
int SHA384Input (SHA384Context *context, const uint8_t *message_array, unsigned int length)
 
int SHA384FinalBits (SHA384Context *context, uint8_t message_bits, unsigned int length)
 
int SHA384Result (SHA384Context *context, uint8_t Message_Digest[SHA384HashSize])
 
int SHA512Reset (SHA512Context *context)
 
int SHA512Input (SHA512Context *context, const uint8_t *message_array, unsigned int length)
 
int SHA512FinalBits (SHA512Context *context, uint8_t message_bits, unsigned int length)
 
int SHA512Result (SHA512Context *context, uint8_t Message_Digest[SHA512HashSize])
 

Variables

static uint64_t addTemp
 
static uint64_t SHA384_H0 []
 
static uint64_t SHA512_H0 []
 

Macro Definition Documentation

◆ SHA384_512AddLength

#define SHA384_512AddLength (   context,
  length 
)
Value:
(addTemp = context->Length_Low, context->Corrupted = \
((context->Length_Low += length) < addTemp) && \
(++context->Length_High == 0) ? shaInputTooLong : \
(context)->Corrupted)
static uint64_t addTemp
Definition: sha384-512.c:302
@ shaInputTooLong
Definition: sha.h:94
context
Definition: tin.h:107

Definition at line 303 of file sha384-512.c.

◆ SHA512_ROTR

#define SHA512_ROTR (   bits,
  word 
)
Value:
((((uint64_t)(word)) >> (bits)) | \
(((uint64_t)(word)) << (64-(bits))))

Definition at line 281 of file sha384-512.c.

◆ SHA512_SHR

#define SHA512_SHR (   bits,
  word 
)    (((uint64_t)(word)) >> (bits))

Definition at line 280 of file sha384-512.c.

◆ SHA512_SIGMA0

#define SHA512_SIGMA0 (   word)     (SHA512_ROTR(28,word) ^ SHA512_ROTR(34,word) ^ SHA512_ROTR(39,word))

Definition at line 289 of file sha384-512.c.

◆ SHA512_sigma0

#define SHA512_sigma0 (   word)     (SHA512_ROTR( 1,word) ^ SHA512_ROTR( 8,word) ^ SHA512_SHR( 7,word))

Definition at line 293 of file sha384-512.c.

◆ SHA512_SIGMA1

#define SHA512_SIGMA1 (   word)     (SHA512_ROTR(14,word) ^ SHA512_ROTR(18,word) ^ SHA512_ROTR(41,word))

Definition at line 291 of file sha384-512.c.

◆ SHA512_sigma1

#define SHA512_sigma1 (   word)     (SHA512_ROTR(19,word) ^ SHA512_ROTR(61,word) ^ SHA512_SHR( 6,word))

Definition at line 295 of file sha384-512.c.

Function Documentation

◆ SHA384_512Finalize()

static void SHA384_512Finalize ( SHA512Context context,
uint8_t  Pad_Byte 
)
static

Definition at line 874 of file sha384-512.c.

References SHA384_512PadMessage(), and SHA512_Message_Block_Size.

Referenced by SHA384_512ResultN(), and SHA512FinalBits().

◆ SHA384_512PadMessage()

static void SHA384_512PadMessage ( SHA512Context context,
uint8_t  Pad_Byte 
)
static

Definition at line 916 of file sha384-512.c.

References SHA384_512ProcessMessageBlock(), and SHA512_Message_Block_Size.

Referenced by SHA384_512Finalize().

◆ SHA384_512ProcessMessageBlock()

static void SHA384_512ProcessMessageBlock ( SHA512Context context)
static

◆ SHA384_512Reset()

static int SHA384_512Reset ( SHA512Context context,
uint64_t  H0[SHA512HashSize/8] 
)
static

Definition at line 593 of file sha384-512.c.

References SHA512HashSize, shaNull, and shaSuccess.

Referenced by SHA384Reset(), and SHA512Reset().

◆ SHA384_512ResultN()

static int SHA384_512ResultN ( SHA512Context context,
uint8_t  Message_Digest[],
int  HashSize 
)
static

Definition at line 1003 of file sha384-512.c.

References SHA384_512Finalize(), shaNull, and shaSuccess.

Referenced by SHA384Result(), and SHA512Result().

◆ SHA384FinalBits()

int SHA384FinalBits ( SHA384Context context,
uint8_t  message_bits,
unsigned int  length 
)

Definition at line 400 of file sha384-512.c.

References SHA512FinalBits().

Referenced by USHAFinalBits().

◆ SHA384Input()

int SHA384Input ( SHA384Context context,
const uint8_t *  message_array,
unsigned int  length 
)

Definition at line 374 of file sha384-512.c.

References SHA512Input().

Referenced by USHAInput().

◆ SHA384Reset()

int SHA384Reset ( SHA384Context context)

Definition at line 349 of file sha384-512.c.

References SHA384_512Reset(), and SHA384_H0.

Referenced by USHAReset().

◆ SHA384Result()

int SHA384Result ( SHA384Context context,
uint8_t  Message_Digest[SHA384HashSize] 
)

Definition at line 426 of file sha384-512.c.

References SHA384_512ResultN(), and SHA384HashSize.

Referenced by USHAResult().

◆ SHA512FinalBits()

int SHA512FinalBits ( SHA512Context context,
uint8_t  message_bits,
unsigned int  length 
)

◆ SHA512Input()

int SHA512Input ( SHA512Context context,
const uint8_t *  message_array,
unsigned int  length 
)

◆ SHA512Reset()

int SHA512Reset ( SHA512Context context)

Definition at line 447 of file sha384-512.c.

References SHA384_512Reset(), and SHA512_H0.

Referenced by USHAReset().

◆ SHA512Result()

int SHA512Result ( SHA512Context context,
uint8_t  Message_Digest[SHA512HashSize] 
)

Definition at line 565 of file sha384-512.c.

References SHA384_512ResultN(), and SHA512HashSize.

Referenced by USHAResult().

Variable Documentation

◆ addTemp

uint64_t addTemp
static

Definition at line 302 of file sha384-512.c.

◆ SHA384_H0

uint64_t SHA384_H0[]
static
Initial value:
= {
0xCBBB9D5DC1059ED8ll, 0x629A292A367CD507ll, 0x9159015A3070DD17ll,
0x152FECD8F70E5939ll, 0x67332667FFC00B31ll, 0x8EB44A8768581511ll,
0xDB0C2E0D64F98FA7ll, 0x47B5481DBEFA4FA4ll
}

Definition at line 321 of file sha384-512.c.

Referenced by SHA384Reset().

◆ SHA512_H0

uint64_t SHA512_H0[]
static
Initial value:
= {
0x6A09E667F3BCC908ll, 0xBB67AE8584CAA73Bll, 0x3C6EF372FE94F82Bll,
0xA54FF53A5F1D36F1ll, 0x510E527FADE682D1ll, 0x9B05688C2B3E6C1Fll,
0x1F83D9ABFB41BD6Bll, 0x5BE0CD19137E2179ll
}

Definition at line 326 of file sha384-512.c.

Referenced by SHA512Reset().