XMSS Library
override_sha256_generic.h File Reference

Prototypes for the SHA-256 hash function override using the generic interface. More...

#include <stddef.h>
#include <stdint.h>
#include "types.h"
Include dependency graph for override_sha256_generic.h:

Go to the source code of this file.

Macros

#define XMSS_OVERRIDE_SHA256_GENERIC_H_INCLUDED
 Include guard.
 

Functions

void * xmss_sha256_init (void)
 Generic digest initialization function. Returns a context for use by the update and finalize functions. The supplier of the generic digest override has full control over the context; the returned context is treated as opaque by the XMSS library. More...
 
void xmss_sha256_update (void *context, const uint8_t *data, size_t data_length)
 Generic digest update function. Updates the internal hash state for a single digest calculation with the additional data supplied. More...
 
void xmss_sha256_finalize (void *context, XmssValue256 *digest)
 Generic digest finalize function. Outputs the digest and disposes the context. More...
 

Detailed Description

Prototypes for the SHA-256 hash function override using the generic interface.

See also
generic_digest.h

Include this file in your override implementation for SHA-256 using the generic digest interface.

Compile the library with CMake as follows:

cmake -DXMSS_SHA256=OverrideGeneric

Function Documentation

◆ xmss_sha256_finalize()

void xmss_sha256_finalize ( void *  context,
XmssValue256 digest 
)

Generic digest finalize function. Outputs the digest and disposes the context.

Parameters
[in]contextAn opaque context, i.e., the result of the most recent call to the initialization function on this thread.
[out]digestThe output of the hash function.
See also
XmssGenericDigestFinalize

This is the specialization for the SHA-256 algorithm.

◆ xmss_sha256_init()

void* xmss_sha256_init ( void  )

Generic digest initialization function. Returns a context for use by the update and finalize functions. The supplier of the generic digest override has full control over the context; the returned context is treated as opaque by the XMSS library.

The library will eventually call the finalize function exactly once for this context.

Returns
An opaque context (may be NULL) for a single digest calculation.
See also
XmssGenericDigestInit

This is the specialization for the SHA-256 algorithm.

◆ xmss_sha256_update()

void xmss_sha256_update ( void *  context,
const uint8_t *  data,
size_t  data_length 
)

Generic digest update function. Updates the internal hash state for a single digest calculation with the additional data supplied.

Parameters
[in]contextAn opaque context, i.e., the result of the most recent call to the initialization function on this thread.
[in]dataThe byte stream of additional data to be included in the message; may be NULL if and only if data_length is zero.
[in]data_lengthThe number of bytes pointed to by data.
See also
XmssGenericDigestUpdate

This is the specialization for the SHA-256 algorithm.