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

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

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

Go to the source code of this file.

Classes

struct  ha_blake2s_context
 BLAKE2s hashing context structure. More...

Macros

#define HA_BLAKE2S_BLOCK_SIZE   64
#define HA_BLAKE2S_DIGEST_SIZE   ha_bB(256)

Typedefs

typedef struct ha_blake2s_context ha_blake2s_context

Functions

HA_PUBFUN void ha_blake2s_init (ha_blake2s_context *ctx)
 Initializes the BLAKE2s hashing context.
HA_PUBFUN void ha_blake2s_update (ha_blake2s_context *ctx, ha_inbuf_t data, size_t len)
 Updates the BLAKE2s hash with input data.
HA_PUBFUN void ha_blake2s_final (ha_blake2s_context *ctx, ha_digest_t digest, size_t digestlen)
 Finalizes the BLAKE2s hash computation.
HA_PUBFUN void ha_blake2s_hash (ha_inbuf_t data, size_t len, ha_digest_t digest, size_t digestlen)
 Computes the BLAKE2s hash of the input data.

Detailed Description

Header file for the BLAKE2s hashing algorithm.

This file provides the interface for the BLAKE2s cryptographic hash function, including the definition of the hash state context and function declarations for initializing, updating, finalizing, and computing the hash in a one-shot operation.

Definition in file blake2s.h.

Macro Definition Documentation

◆ HA_BLAKE2S_BLOCK_SIZE

#define HA_BLAKE2S_BLOCK_SIZE   64

Definition at line 16 of file blake2s.h.

◆ HA_BLAKE2S_DIGEST_SIZE

#define HA_BLAKE2S_DIGEST_SIZE   ha_bB(256)

Definition at line 17 of file blake2s.h.

Typedef Documentation

◆ ha_blake2s_context

typedef struct ha_blake2s_context ha_blake2s_context

Function Documentation

◆ ha_blake2s_final()

HA_PUBFUN void ha_blake2s_final ( ha_blake2s_context * ctx,
ha_digest_t digest,
size_t digestlen )

Finalizes the BLAKE2s hash computation.

This function finalizes the hash and writes the output to the provided buffer.

Parameters
ctxPointer to the BLAKE2s context.
digestPointer to the output buffer (must be at least outlen bytes).
digestlenDesired length of the hash output in bytes (1–32).

◆ ha_blake2s_hash()

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

Computes the BLAKE2s hash of the input data.

This function performs a one-shot hash computation, initializing, updating, and finalizing the context in a single call.

Parameters
dataPointer to the input data.
lenLength of the input data in bytes.
digestPointer to the output buffer (must be at least digestlen bytes).
digestlenDesired length of the hash output in bytes (1–32).

◆ ha_blake2s_init()

HA_PUBFUN void ha_blake2s_init ( ha_blake2s_context * ctx)

Initializes the BLAKE2s hashing context.

Parameters
ctxPointer to the BLAKE2s context.

◆ ha_blake2s_update()

HA_PUBFUN void ha_blake2s_update ( ha_blake2s_context * ctx,
ha_inbuf_t data,
size_t len )

Updates the BLAKE2s hash with input data.

This function processes the input data in blocks, updating the internal state.

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