libhasha 2.2.2
Loading...
Searching...
No Matches
sha2.h File Reference

Header file for SHA-2 cryptographic hash functions. More...

Include dependency graph for sha2.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ha_sha2_224_context
 Context structure for SHA-2 224-bit hashing. More...
struct  ha_sha2_256_context
 Context structure for SHA-2 256-bit hashing. More...
struct  ha_sha2_384_context
 Context structure for SHA-2 384-bit hashing. More...
struct  ha_sha2_512_context
 Context structure for SHA-2 512-bit hashing. More...
struct  ha_sha2_512_224_context
 Context structure for SHA-2 512-224-bit hashing. More...
struct  ha_sha2_512_256_context
 Context structure for SHA-2 512-256-bit hashing. More...

Macros

#define HA_SHA2_224_BLOCK_SIZE   64
 The block size in bytes for the SHA-2 224-bit algorithm (64 bytes).
#define HA_SHA2_224_DIGEST_SIZE   ha_bB(224)
 The digest size in bytes for the SHA-2 224-bit algorithm (28 bytes).
#define HA_SHA2_256_BLOCK_SIZE   64
 The block size in bytes for the SHA-2 256-bit algorithm (64 bytes).
#define HA_SHA2_256_DIGEST_SIZE   ha_bB(256)
 The digest size in bytes for the SHA-2 256-bit algorithm (32 bytes).
#define HA_SHA2_384_BLOCK_SIZE   128
 The block size in bytes for the SHA-2 384-bit algorithm (128 bytes).
#define HA_SHA2_384_DIGEST_SIZE   ha_bB(384)
 The digest size in bytes for the SHA-2 384-bit algorithm (48 bytes).
#define HA_SHA2_512_BLOCK_SIZE   128
 The block size in bytes for the SHA-2 512-bit algorithm (128 bytes).
#define HA_SHA2_512_DIGEST_SIZE   ha_bB(512)
 The digest size in bytes for the SHA-2 512-bit algorithm (64 bytes).
#define HA_SHA2_512_224_BLOCK_SIZE   128
 The block size in bytes for the SHA-2 512-224 algorithm (128 bytes).
#define HA_SHA2_512_224_DIGEST_SIZE   ha_bB(224)
 The digest size in bytes for the SHA-2 512-224 algorithm (28 bytes).
#define HA_SHA2_512_256_BLOCK_SIZE   128
 The block size in bytes for the SHA-2 512-256 algorithm (128 bytes).
#define HA_SHA2_512_256_DIGEST_SIZE   ha_bB(256)
 The digest size in bytes for the SHA-2 512-256 algorithm (32 bytes).

Typedefs

typedef struct ha_sha2_224_context ha_sha2_224_context
typedef struct ha_sha2_256_context ha_sha2_256_context
typedef struct ha_sha2_384_context ha_sha2_384_context
typedef struct ha_sha2_512_context ha_sha2_512_context
typedef struct ha_sha2_512_224_context ha_sha2_512_224_context
typedef struct ha_sha2_512_256_context ha_sha2_512_256_context

Functions

HA_PUBFUN void ha_sha2_224_transform (ha_sha2_224_context *ctx, ha_inbuf_t data)
 Transforms the data in the SHA-2 224-bit context.
HA_PUBFUN void ha_sha2_224_init (ha_sha2_224_context *ctx)
 Initializes the SHA-2 224-bit context.
HA_PUBFUN void ha_sha2_224_update (ha_sha2_224_context *ctx, ha_inbuf_t data, size_t length)
 Updates the SHA-2 224-bit context with new data.
HA_PUBFUN void ha_sha2_224_final (ha_sha2_224_context *ctx, ha_digest_t digest)
 Finalizes the SHA-2 224-bit computation and produces the hash digest.
HA_PUBFUN void ha_sha2_224_hash (ha_inbuf_t data, size_t length, ha_digest_t digest)
 Computes the SHA-2 224-bit hash in a one-shot operation.
HA_PUBFUN void ha_sha2_256_transform (ha_sha2_256_context *ctx, ha_inbuf_t data)
 Transforms the data in the SHA-2 256-bit context.
HA_PUBFUN void ha_sha2_256_init (ha_sha2_256_context *ctx)
 Initializes the SHA-2 256-bit context.
HA_PUBFUN void ha_sha2_256_update (ha_sha2_256_context *ctx, ha_inbuf_t data, size_t length)
 Updates the SHA-2 256-bit context with new data.
HA_PUBFUN void ha_sha2_256_final (ha_sha2_256_context *ctx, ha_digest_t digest)
 Finalizes the SHA-2 256-bit computation and produces the hash digest.
HA_PUBFUN void ha_sha2_256_hash (ha_inbuf_t data, size_t length, ha_digest_t digest)
 Computes the SHA-2 256-bit hash in a one-shot operation.
HA_PUBFUN void ha_sha2_384_transform (ha_sha2_384_context *ctx, ha_inbuf_t data)
 Transforms the data in the SHA-2 384-bit context.
HA_PUBFUN void ha_sha2_384_init (ha_sha2_384_context *ctx)
 Initializes the SHA-2 384-bit context.
HA_PUBFUN void ha_sha2_384_update (ha_sha2_384_context *ctx, ha_inbuf_t data, size_t length)
 Updates the SHA-2 384-bit context with new data.
HA_PUBFUN void ha_sha2_384_final (ha_sha2_384_context *ctx, ha_digest_t digest)
 Finalizes the SHA-2 384-bit computation and produces the hash digest.
HA_PUBFUN void ha_sha2_384_hash (ha_inbuf_t data, size_t length, ha_digest_t digest)
 Computes the SHA-2 384-bit hash in a one-shot operation.
HA_PUBFUN void ha_sha2_512_transform (ha_sha2_512_context *ctx, ha_inbuf_t data)
 Transforms the data in the SHA-2 512-bit context.
HA_PUBFUN void ha_sha2_512_init (ha_sha2_512_context *ctx)
 Initializes the SHA-2 512-bit context.
HA_PUBFUN void ha_sha2_512_update (ha_sha2_512_context *ctx, ha_inbuf_t data, size_t length)
 Updates the SHA-2 512-bit context with new data.
HA_PUBFUN void ha_sha2_512_final (ha_sha2_512_context *ctx, ha_digest_t digest)
 Finalizes the SHA-2 512-bit computation and produces the hash digest.
HA_PUBFUN void ha_sha2_512_hash (ha_inbuf_t data, size_t length, ha_digest_t digest)
 Computes the SHA-2 512-bit hash in a one-shot operation.
HA_PUBFUN void ha_sha2_512_224_transform (ha_sha2_512_224_context *ctx, ha_inbuf_t data)
 Transforms the data in the SHA-2 512-224-bit context.
HA_PUBFUN void ha_sha2_512_224_init (ha_sha2_512_224_context *ctx)
 Initializes the SHA-2 512-224-bit context.
HA_PUBFUN void ha_sha2_512_224_update (ha_sha2_512_224_context *ctx, ha_inbuf_t data, size_t length)
 Updates the SHA-2 512-224-bit context with new data.
HA_PUBFUN void ha_sha2_512_224_final (ha_sha2_512_224_context *ctx, ha_digest_t digest)
 Finalizes the SHA-2 512-224-bit computation and produces the hash digest.
HA_PUBFUN void ha_sha2_512_224_hash (ha_inbuf_t data, size_t length, ha_digest_t digest)
 Computes the SHA-2 512-224-bit hash in a one-shot operation.
HA_PUBFUN void ha_sha2_512_256_transform (ha_sha2_512_256_context *ctx, ha_inbuf_t data)
 Transforms the data in the SHA-2 512-256-bit context.
HA_PUBFUN void ha_sha2_512_256_init (ha_sha2_512_256_context *ctx)
 Initializes the SHA-2 512-256-bit context.
HA_PUBFUN void ha_sha2_512_256_update (ha_sha2_512_256_context *ctx, ha_inbuf_t data, size_t length)
 Updates the SHA-2 512-256-bit context with new data.
HA_PUBFUN void ha_sha2_512_256_final (ha_sha2_512_256_context *ctx, ha_digest_t digest)
 Finalizes the SHA-2 512-256-bit computation and produces the hash digest.
HA_PUBFUN void ha_sha2_512_256_hash (ha_inbuf_t data, size_t length, ha_digest_t digest)
 Computes the SHA-2 512-256-bit hash in a one-shot operation.

Detailed Description

Header file for SHA-2 cryptographic hash functions.

This header file defines the interface for the SHA-2 family of hash algorithms, including SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, and SHA-512/256.

It provides macro definitions for block and digest sizes, context structures for maintaining the hash state, and declarations for functions that perform the core transformations, initialization, updating, finalization, and one-shot hash computations. The implementation adheres to the standards specified in FIPS 180-4.

Note
The SHA-2 algorithms defined in this file process data in fixed-size blocks and output a fixed-length digest. They are designed for high performance and security in cryptographic applications.
See also
https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf for further details on SHA-2.

Definition in file sha2.h.

Macro Definition Documentation

◆ HA_SHA2_224_BLOCK_SIZE

#define HA_SHA2_224_BLOCK_SIZE   64

The block size in bytes for the SHA-2 224-bit algorithm (64 bytes).

Definition at line 42 of file sha2.h.

◆ HA_SHA2_224_DIGEST_SIZE

#define HA_SHA2_224_DIGEST_SIZE   ha_bB(224)

The digest size in bytes for the SHA-2 224-bit algorithm (28 bytes).

Definition at line 49 of file sha2.h.

◆ HA_SHA2_256_BLOCK_SIZE

#define HA_SHA2_256_BLOCK_SIZE   64

The block size in bytes for the SHA-2 256-bit algorithm (64 bytes).

Definition at line 56 of file sha2.h.

◆ HA_SHA2_256_DIGEST_SIZE

#define HA_SHA2_256_DIGEST_SIZE   ha_bB(256)

The digest size in bytes for the SHA-2 256-bit algorithm (32 bytes).

Definition at line 63 of file sha2.h.

◆ HA_SHA2_384_BLOCK_SIZE

#define HA_SHA2_384_BLOCK_SIZE   128

The block size in bytes for the SHA-2 384-bit algorithm (128 bytes).

Definition at line 70 of file sha2.h.

◆ HA_SHA2_384_DIGEST_SIZE

#define HA_SHA2_384_DIGEST_SIZE   ha_bB(384)

The digest size in bytes for the SHA-2 384-bit algorithm (48 bytes).

Definition at line 77 of file sha2.h.

◆ HA_SHA2_512_224_BLOCK_SIZE

#define HA_SHA2_512_224_BLOCK_SIZE   128

The block size in bytes for the SHA-2 512-224 algorithm (128 bytes).

Definition at line 98 of file sha2.h.

◆ HA_SHA2_512_224_DIGEST_SIZE

#define HA_SHA2_512_224_DIGEST_SIZE   ha_bB(224)

The digest size in bytes for the SHA-2 512-224 algorithm (28 bytes).

Definition at line 105 of file sha2.h.

◆ HA_SHA2_512_256_BLOCK_SIZE

#define HA_SHA2_512_256_BLOCK_SIZE   128

The block size in bytes for the SHA-2 512-256 algorithm (128 bytes).

Definition at line 112 of file sha2.h.

◆ HA_SHA2_512_256_DIGEST_SIZE

#define HA_SHA2_512_256_DIGEST_SIZE   ha_bB(256)

The digest size in bytes for the SHA-2 512-256 algorithm (32 bytes).

Definition at line 119 of file sha2.h.

◆ HA_SHA2_512_BLOCK_SIZE

#define HA_SHA2_512_BLOCK_SIZE   128

The block size in bytes for the SHA-2 512-bit algorithm (128 bytes).

Definition at line 84 of file sha2.h.

◆ HA_SHA2_512_DIGEST_SIZE

#define HA_SHA2_512_DIGEST_SIZE   ha_bB(512)

The digest size in bytes for the SHA-2 512-bit algorithm (64 bytes).

Definition at line 91 of file sha2.h.

Typedef Documentation

◆ ha_sha2_224_context

typedef struct ha_sha2_224_context ha_sha2_224_context

◆ ha_sha2_256_context

typedef struct ha_sha2_256_context ha_sha2_256_context

◆ ha_sha2_384_context

typedef struct ha_sha2_384_context ha_sha2_384_context

◆ ha_sha2_512_224_context

typedef struct ha_sha2_512_224_context ha_sha2_512_224_context

◆ ha_sha2_512_256_context

typedef struct ha_sha2_512_256_context ha_sha2_512_256_context

◆ ha_sha2_512_context

typedef struct ha_sha2_512_context ha_sha2_512_context

Function Documentation

◆ ha_sha2_224_final()

HA_PUBFUN void ha_sha2_224_final ( ha_sha2_224_context * ctx,
ha_digest_t digest )

Finalizes the SHA-2 224-bit computation and produces the hash digest.

This function finals the SHA-2 224-bit hash calculation and outputs the resulting digest into the provided buffer.

Parameters
ctxPointer to the SHA-2 224-bit context structure.
digestPointer to the output buffer to store the final SHA-2 224-bit digest (28 bytes).

◆ ha_sha2_224_hash()

HA_PUBFUN void ha_sha2_224_hash ( ha_inbuf_t data,
size_t length,
ha_digest_t digest )

Computes the SHA-2 224-bit hash in a one-shot operation.

This function computes the SHA-2 224-bit hash of the provided data in a single call. It initializes, updates, and finals the SHA-2 224-bit computation internally.

Parameters
dataPointer to the input data to process.
lengthLength of the input data in bytes.
digestPointer to the output buffer to store the final SHA-2 224-bit digest (28 bytes).

◆ ha_sha2_224_init()

HA_PUBFUN void ha_sha2_224_init ( ha_sha2_224_context * ctx)

Initializes the SHA-2 224-bit context.

This function initializes the SHA-2 224-bit context to start a new hash computation.

Parameters
ctxPointer to the SHA-2 224-bit context structure to initialize.

◆ ha_sha2_224_transform()

HA_PUBFUN void ha_sha2_224_transform ( ha_sha2_224_context * ctx,
ha_inbuf_t data )

Transforms the data in the SHA-2 224-bit context.

This function performs the transformation step of the SHA-2 224-bit hash computation. It processes the input data block and updates the internal state of the context.

Parameters
ctxPointer to the SHA-2 224-bit context structure.
dataPointer to the input data block (64 bytes).

◆ ha_sha2_224_update()

HA_PUBFUN void ha_sha2_224_update ( ha_sha2_224_context * ctx,
ha_inbuf_t data,
size_t length )

Updates the SHA-2 224-bit context with new data.

This function processes the provided data and updates the SHA-2 224-bit context state.

Parameters
ctxPointer to the SHA-2 224-bit context structure.
dataPointer to the input data to process.
lengthLength of the input data in bytes.

◆ ha_sha2_256_final()

HA_PUBFUN void ha_sha2_256_final ( ha_sha2_256_context * ctx,
ha_digest_t digest )

Finalizes the SHA-2 256-bit computation and produces the hash digest.

This function finals the SHA-2 256-bit hash calculation and outputs the resulting digest into the provided buffer.

Parameters
ctxPointer to the SHA-2 256-bit context structure.
digestPointer to the output buffer to store the final SHA-2 256-bit digest (32 bytes).

◆ ha_sha2_256_hash()

HA_PUBFUN void ha_sha2_256_hash ( ha_inbuf_t data,
size_t length,
ha_digest_t digest )

Computes the SHA-2 256-bit hash in a one-shot operation.

This function computes the SHA-2 256-bit hash of the provided data in a single call. It initializes, updates, and finals the SHA-2 256-bit computation internally.

Parameters
dataPointer to the input data to process.
lengthLength of the input data in bytes.
digestPointer to the output buffer to store the final SHA-2 256-bit digest (32 bytes).

◆ ha_sha2_256_init()

HA_PUBFUN void ha_sha2_256_init ( ha_sha2_256_context * ctx)

Initializes the SHA-2 256-bit context.

This function initializes the SHA-2 256-bit context to start a new hash computation.

Parameters
ctxPointer to the SHA-2 256-bit context structure to initialize.

◆ ha_sha2_256_transform()

HA_PUBFUN void ha_sha2_256_transform ( ha_sha2_256_context * ctx,
ha_inbuf_t data )

Transforms the data in the SHA-2 256-bit context.

This function performs the transformation step of the SHA-2 256-bit hash computation. It processes the input data block and updates the internal state of the context.

Parameters
ctxPointer to the SHA-2 256-bit context structure.
dataPointer to the input data block (64 bytes).

◆ ha_sha2_256_update()

HA_PUBFUN void ha_sha2_256_update ( ha_sha2_256_context * ctx,
ha_inbuf_t data,
size_t length )

Updates the SHA-2 256-bit context with new data.

This function processes the provided data and updates the SHA-2 256-bit context state.

Parameters
ctxPointer to the SHA-2 256-bit context structure.
dataPointer to the input data to process.
lengthLength of the input data in bytes.

◆ ha_sha2_384_final()

HA_PUBFUN void ha_sha2_384_final ( ha_sha2_384_context * ctx,
ha_digest_t digest )

Finalizes the SHA-2 384-bit computation and produces the hash digest.

This function finals the SHA-2 384-bit hash calculation and outputs the resulting digest into the provided buffer.

Parameters
ctxPointer to the SHA-2 384-bit context structure.
digestPointer to the output buffer to store the final SHA-2 384-bit digest (48 bytes).

◆ ha_sha2_384_hash()

HA_PUBFUN void ha_sha2_384_hash ( ha_inbuf_t data,
size_t length,
ha_digest_t digest )

Computes the SHA-2 384-bit hash in a one-shot operation.

This function computes the SHA-2 384-bit hash of the provided data in a single call. It initializes, updates, and finals the SHA-2 384-bit computation internally.

Parameters
dataPointer to the input data to process.
lengthLength of the input data in bytes.
digestPointer to the output buffer to store the final SHA-2 384-bit digest (48 bytes).

◆ ha_sha2_384_init()

HA_PUBFUN void ha_sha2_384_init ( ha_sha2_384_context * ctx)

Initializes the SHA-2 384-bit context.

This function initializes the SHA-2 384-bit context to start a new hash computation.

Parameters
ctxPointer to the SHA-2 384-bit context structure to initialize.

◆ ha_sha2_384_transform()

HA_PUBFUN void ha_sha2_384_transform ( ha_sha2_384_context * ctx,
ha_inbuf_t data )

Transforms the data in the SHA-2 384-bit context.

This function performs the transformation step of the SHA-2 384-bit hash computation. It processes the input data block and updates the internal state of the context.

Parameters
ctxPointer to the SHA-2 384-bit context structure.
dataPointer to the input data block (128 bytes).

◆ ha_sha2_384_update()

HA_PUBFUN void ha_sha2_384_update ( ha_sha2_384_context * ctx,
ha_inbuf_t data,
size_t length )

Updates the SHA-2 384-bit context with new data.

This function processes the provided data and updates the SHA-2 384-bit context state.

Parameters
ctxPointer to the SHA-2 384-bit context structure.
dataPointer to the input data to process.
lengthLength of the input data in bytes.

◆ ha_sha2_512_224_final()

HA_PUBFUN void ha_sha2_512_224_final ( ha_sha2_512_224_context * ctx,
ha_digest_t digest )

Finalizes the SHA-2 512-224-bit computation and produces the hash digest.

This function finals the SHA-2 512-224-bit hash calculation and outputs the resulting digest into the provided buffer.

Parameters
ctxPointer to the SHA-2 512-224-bit context structure.
digestPointer to the output buffer to store the final SHA-2 512-224-bit digest (28 bytes).

◆ ha_sha2_512_224_hash()

HA_PUBFUN void ha_sha2_512_224_hash ( ha_inbuf_t data,
size_t length,
ha_digest_t digest )

Computes the SHA-2 512-224-bit hash in a one-shot operation.

This function computes the SHA-2 512-224-bit hash of the provided data in a single call. It initializes, updates, and finals the SHA-2 512-224-bit computation internally.

Parameters
dataPointer to the input data to process.
lengthLength of the input data in bytes.
digestPointer to the output buffer to store the final SHA-2 512-224-bit digest (28 bytes).

◆ ha_sha2_512_224_init()

HA_PUBFUN void ha_sha2_512_224_init ( ha_sha2_512_224_context * ctx)

Initializes the SHA-2 512-224-bit context.

This function initializes the SHA-2 512-224-bit context to start a new hash computation.

Parameters
ctxPointer to the SHA-2 512-224-bit context structure to initialize.

◆ ha_sha2_512_224_transform()

HA_PUBFUN void ha_sha2_512_224_transform ( ha_sha2_512_224_context * ctx,
ha_inbuf_t data )

Transforms the data in the SHA-2 512-224-bit context.

This function performs the transformation step of the SHA-2 512-224-bit hash computation. It processes the input data block and updates the internal state of the context.

Parameters
ctxPointer to the SHA-2 512-224-bit context structure.
dataPointer to the input data block (128 bytes).

◆ ha_sha2_512_224_update()

HA_PUBFUN void ha_sha2_512_224_update ( ha_sha2_512_224_context * ctx,
ha_inbuf_t data,
size_t length )

Updates the SHA-2 512-224-bit context with new data.

This function processes the provided data and updates the SHA-2 512-224-bit context state.

Parameters
ctxPointer to the SHA-2 512-224-bit context structure.
dataPointer to the input data to process.
lengthLength of the input data in bytes.

◆ ha_sha2_512_256_final()

HA_PUBFUN void ha_sha2_512_256_final ( ha_sha2_512_256_context * ctx,
ha_digest_t digest )

Finalizes the SHA-2 512-256-bit computation and produces the hash digest.

This function finals the SHA-2 512-256-bit hash calculation and outputs the resulting digest into the provided buffer.

Parameters
ctxPointer to the SHA-2 512-256-bit context structure.
digestPointer to the output buffer to store the final SHA-2 512-256-bit digest (32 bytes).

◆ ha_sha2_512_256_hash()

HA_PUBFUN void ha_sha2_512_256_hash ( ha_inbuf_t data,
size_t length,
ha_digest_t digest )

Computes the SHA-2 512-256-bit hash in a one-shot operation.

This function computes the SHA-2 512-256-bit hash of the provided data in a single call. It initializes, updates, and finals the SHA-2 512-256-bit computation internally.

Parameters
dataPointer to the input data to process.
lengthLength of the input data in bytes.
digestPointer to the output buffer to store the final SHA-2 512-256-bit digest (32 bytes).

◆ ha_sha2_512_256_init()

HA_PUBFUN void ha_sha2_512_256_init ( ha_sha2_512_256_context * ctx)

Initializes the SHA-2 512-256-bit context.

This function initializes the SHA-2 512-256-bit context to start a new hash computation.

Parameters
ctxPointer to the SHA-2 512-256-bit context structure to initialize.

◆ ha_sha2_512_256_transform()

HA_PUBFUN void ha_sha2_512_256_transform ( ha_sha2_512_256_context * ctx,
ha_inbuf_t data )

Transforms the data in the SHA-2 512-256-bit context.

This function performs the transformation step of the SHA-2 512-256-bit hash computation. It processes the input data block and updates the internal state of the context.

Parameters
ctxPointer to the SHA-2 512-256-bit context structure.
dataPointer to the input data block (128 bytes).

◆ ha_sha2_512_256_update()

HA_PUBFUN void ha_sha2_512_256_update ( ha_sha2_512_256_context * ctx,
ha_inbuf_t data,
size_t length )

Updates the SHA-2 512-256-bit context with new data.

This function processes the provided data and updates the SHA-2 512-256-bit context state.

Parameters
ctxPointer to the SHA-2 512-256-bit context structure.
dataPointer to the input data to process.
lengthLength of the input data in bytes.

◆ ha_sha2_512_final()

HA_PUBFUN void ha_sha2_512_final ( ha_sha2_512_context * ctx,
ha_digest_t digest )

Finalizes the SHA-2 512-bit computation and produces the hash digest.

This function finals the SHA-2 512-bit hash calculation and outputs the resulting digest into the provided buffer.

Parameters
ctxPointer to the SHA-2 512-bit context structure.
digestPointer to the output buffer to store the final SHA-2 512-bit digest (64 bytes).

◆ ha_sha2_512_hash()

HA_PUBFUN void ha_sha2_512_hash ( ha_inbuf_t data,
size_t length,
ha_digest_t digest )

Computes the SHA-2 512-bit hash in a one-shot operation.

This function computes the SHA-2 512-bit hash of the provided data in a single call. It initializes, updates, and finals the SHA-2 512-bit computation internally.

Parameters
dataPointer to the input data to process.
lengthLength of the input data in bytes.
digestPointer to the output buffer to store the final SHA-2 512-bit digest (64 bytes).

◆ ha_sha2_512_init()

HA_PUBFUN void ha_sha2_512_init ( ha_sha2_512_context * ctx)

Initializes the SHA-2 512-bit context.

This function initializes the SHA-2 512-bit context to start a new hash computation.

Parameters
ctxPointer to the SHA-2 512-bit context structure to initialize.

◆ ha_sha2_512_transform()

HA_PUBFUN void ha_sha2_512_transform ( ha_sha2_512_context * ctx,
ha_inbuf_t data )

Transforms the data in the SHA-2 512-bit context.

This function performs the transformation step of the SHA-2 512-bit hash computation. It processes the input data block and updates the internal state of the context.

Parameters
ctxPointer to the SHA-2 512-bit context structure.
dataPointer to the input data block (128 bytes).

◆ ha_sha2_512_update()

HA_PUBFUN void ha_sha2_512_update ( ha_sha2_512_context * ctx,
ha_inbuf_t data,
size_t length )

Updates the SHA-2 512-bit context with new data.

This function processes the provided data and updates the SHA-2 512-bit context state.

Parameters
ctxPointer to the SHA-2 512-bit context structure.
dataPointer to the input data to process.
lengthLength of the input data in bytes.