libmoost
/home/mhx/git/github/libmoost/src/digest/rfc6234/sha384-512.c File Reference
#include "sha.h"
#include "sha-private.h"
Include dependency graph for sha384-512.c:

Go to the source code of this file.

Defines

#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 []

Define Documentation

#define SHA384_512AddLength (   context,
  length 
)
Value:
(addTemp = context->Length_Low, context->Corrupted =        \
    ((context->Length_Low += length) < addTemp) &&             \
    (++context->Length_High == 0) ? shaInputTooLong :          \
                                    (context)->Corrupted)

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

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

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

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

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

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

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

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

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

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

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

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

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


Function Documentation

static void SHA384_512Finalize ( SHA512Context context,
uint8_t  Pad_Byte 
) [static]

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

Here is the call graph for this function:

Here is the caller graph for this function:

static void SHA384_512PadMessage ( SHA512Context context,
uint8_t  Pad_Byte 
) [static]

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

Here is the call graph for this function:

Here is the caller graph for this function:

static void SHA384_512ProcessMessageBlock ( SHA512Context context) [static]

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

Here is the caller graph for this function:

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

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

Here is the caller graph for this function:

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Here is the call graph for this function:

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

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

Here is the call graph for this function:

int SHA384Reset ( SHA384Context context)

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

Here is the call graph for this function:

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

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

Here is the call graph for this function:

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

int SHA512Reset ( SHA512Context context)

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

Here is the call graph for this function:

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

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

Here is the call graph for this function:


Variable Documentation

uint64_t addTemp [static]

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

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

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

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

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