Loading...
Searching...
No Matches

Implementation of the SHA-512/256 hashing function. More...

Detailed Description

Implementation of the SHA-512/256 hashing function.

Files

file  sha512_256.h
 Header definitions for the SHA512/256 hash function.
 

Macros

#define SHA512_256_DIGEST_LENGTH   (32)
 Length of SHA512_256 digests in bytes.
 
#define SHA512_256_INTERNAL_BLOCK_SIZE   (128)
 1024 Bit (128 Byte) internally used block size for sha512_256
 

Typedefs

typedef sha512_common_context_t sha512_256_context_t
 Context for cipher operations based on sha512_256.
 

Functions

void sha512_256_init (sha512_256_context_t *ctx)
 SHA-512/256 initialization.
 
static void sha512_256_update (sha512_256_context_t *ctx, const void *data, size_t len)
 Add bytes into the hash.
 
static void sha512_256_final (sha512_256_context_t *ctx, void *digest)
 SHA-512/256 finalization.
 
void sha512_256 (const void *data, size_t len, void *digest)
 A wrapper function to simplify the generation of a hash.
 

Macro Definition Documentation

◆ SHA512_256_DIGEST_LENGTH

#define SHA512_256_DIGEST_LENGTH   (32)

Length of SHA512_256 digests in bytes.

Definition at line 36 of file sha512_256.h.

◆ SHA512_256_INTERNAL_BLOCK_SIZE

#define SHA512_256_INTERNAL_BLOCK_SIZE   (128)

1024 Bit (128 Byte) internally used block size for sha512_256

Definition at line 41 of file sha512_256.h.

Typedef Documentation

◆ sha512_256_context_t

Context for cipher operations based on sha512_256.

Definition at line 46 of file sha512_256.h.

Function Documentation

◆ sha512_256()

void sha512_256 ( const void *  data,
size_t  len,
void *  digest 
)

A wrapper function to simplify the generation of a hash.

This is useful for generating sha512_256 for one single buffer in a single step.

Parameters
[in]datapointer to the buffer to generate hash from
[in]lenlength of the buffer
[out]digestoptional pointer to an array for the result, length must be at least SHA512_256_DIGEST_LENGTH

◆ sha512_256_final()

static void sha512_256_final ( sha512_256_context_t ctx,
void *  digest 
)
inlinestatic

SHA-512/256 finalization.

Pads the input data, exports the hash value, and clears the context state.

Parameters
ctxsha512_256_context_t handle to use, must not be NULL
[out]digestpointer to resulting digest, this is the hash of all the bytes. Length must be at least SHA512_256_DIGEST_LENGTH

Definition at line 75 of file sha512_256.h.

◆ sha512_256_init()

void sha512_256_init ( sha512_256_context_t ctx)

SHA-512/256 initialization.

Begins a SHA-512/256 operation.

Parameters
ctxsha512_256_context_t handle to init, must not be NULL

◆ sha512_256_update()

static void sha512_256_update ( sha512_256_context_t ctx,
const void *  data,
size_t  len 
)
inlinestatic

Add bytes into the hash.

Parameters
ctxsha512_256_context_t handle to use, must not be NULL
[in]dataInput data
[in]lenLength of data

Definition at line 62 of file sha512_256.h.