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

Header file for the BLAKE2b hashing algorithm. More...

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

Go to the source code of this file.

Classes

struct  ha_blake2b_context
 BLAKE2B hashing context structure. More...

Macros

#define HA_BLAKE2B_BLOCK_SIZE   128
 The size of a BLAKE2B block in bytes.
#define HA_BLAKE2B_DIGEST_SIZE   ha_bB(512)
 The default output digest size for BLAKE2B (512 bits).

Typedefs

typedef struct ha_blake2b_context ha_blake2b_context

Functions

HA_PUBFUN void ha_blake2b_init (ha_blake2b_context *ctx)
 Initializes a BLAKE2B context.
HA_PUBFUN void ha_blake2b_update (ha_blake2b_context *ctx, ha_inbuf_t data, size_t len)
 Updates the BLAKE2B hash state with input data.
HA_PUBFUN void ha_blake2b_final (ha_blake2b_context *ctx, ha_digest_t digest, size_t digestlen)
 Finalizes the BLAKE2B hash and produces the digest.
HA_PUBFUN void ha_blake2b_hash (ha_inbuf_t data, size_t len, ha_digest_t digest, size_t digestlen)
 Computes the BLAKE2B hash in a one-shot operation.

Detailed Description

Header file for the BLAKE2b hashing algorithm.

This file provides the interface for the BLAKE2b cryptographic hash function. It includes the definition of the hash state context and function declarations for initializing, updating, finalizing, and computing the hash in a one-shot operation. BLAKE2b is optimized for 64-bit platforms and offers high security and performance.

Definition in file blake2b.h.

Macro Definition Documentation

◆ HA_BLAKE2B_BLOCK_SIZE

#define HA_BLAKE2B_BLOCK_SIZE   128

The size of a BLAKE2B block in bytes.

Definition at line 20 of file blake2b.h.

◆ HA_BLAKE2B_DIGEST_SIZE

#define HA_BLAKE2B_DIGEST_SIZE   ha_bB(512)

The default output digest size for BLAKE2B (512 bits).

Definition at line 25 of file blake2b.h.

Typedef Documentation

◆ ha_blake2b_context

typedef struct ha_blake2b_context ha_blake2b_context

Function Documentation

◆ ha_blake2b_final()

HA_PUBFUN void ha_blake2b_final ( ha_blake2b_context * ctx,
ha_digest_t digest,
size_t digestlen )

Finalizes the BLAKE2B hash and produces the digest.

Parameters
ctxPointer to the initialized BLAKE2B context.
digestPointer to the output buffer where the hash will be stored.
digestlenDesired length of the output hash (1 to 64 bytes).

◆ ha_blake2b_hash()

HA_PUBFUN void ha_blake2b_hash ( ha_inbuf_t data,
size_t len,
ha_digest_t digest,
size_t digestlen )

Computes the BLAKE2B hash in a one-shot operation.

This function initializes a BLAKE2B context, processes the input data, and finalizes the hash computation, storing the result in the provided buffer.

Parameters
dataPointer to the input data.
lenLength of the input data in bytes.
digestPointer to the output buffer where the hash will be stored.
digestlenDesired length of the output hash (1 to 64 bytes).

◆ ha_blake2b_init()

HA_PUBFUN void ha_blake2b_init ( ha_blake2b_context * ctx)

Initializes a BLAKE2B context.

Parameters
ctxPointer to the BLAKE2B context to initialize.

◆ ha_blake2b_update()

HA_PUBFUN void ha_blake2b_update ( ha_blake2b_context * ctx,
ha_inbuf_t data,
size_t len )

Updates the BLAKE2B hash state with input data.

Parameters
ctxPointer to the initialized BLAKE2B context.
dataPointer to the input data.
lenLength of the input data in bytes.