Welcome to little lamb

Code » limb » release » tree

[release] / src / doc / hasher.h / hasher.h.0.md

% limb manual
% hasher.h(0)
% limb 0.1.0
% 2023-07-24

# NAME

hasher.h - generic message digest interface

# SYNOPSIS

    #include <limb/hasher.h>

# DESCRIPTION

This header defines the required functions to compute message digests through a
generic interface.

## Types

The following types are defined :

: *hasher_init*
:: Generic pointer function for context initialization

: *hasher_upate*
:: Generic pointer function for feeding data into a hashing context

: *hasher_final*
:: Generic pointer function for computing/obtaining the message digest

## Constants

The following constants are defined :

: *ALGO_SHA1*, *ALGO_SHA256*, *ALGO_SHA512*, *ALGO_SHA3_224*, *ALGO_SHA3_256*,
: *ALGO_SHA3_384*, *ALGO_SHA3_512*, *ALGO_BLAKE3*
:: Indices to identify each of the algorithms for which a hasher is available
:: in the arrays *algos* and *hashers*.

: *NB_AGLOS*
:: Number of elements/algorithms.

## Structures

The following structures are defined :

: *struct hasher*, *hasher*
:: A structure representing a hasher, allowing to compute a message digest
:: through the algorithm of said hasher.

## Pointers

The following pointers are defined :

: *algos*
:: Pointer to an NULL-terminated array of *NB_ALGOS* strings naming the
:: algorithms.

: *hashers*
:: Pointer to an array of *NB_ALGOS* pointers to the available *hasher*s.

## Functions

The following functions/macros are defined :

: [hasher_hash](3)
:: To compute the message digest through a given hasher

: [hinit](3)
:: To initialize a hasher.

: [hupdate](3)
:: To feed data into a hasher.

: [hfinal](3)
:: To obtain the hash from a hasher.

# SEE ALSO

[hmac.h](0), [pbkdf2.h](0)