GNU libmicrohttpd 1.0.0
Loading...
Searching...
No Matches
sha256_ext.c File Reference
#include <gnutls/crypto.h>
#include "sha256_ext.h"
#include "mhd_assert.h"
Include dependency graph for sha256_ext.c:

Go to the source code of this file.

Functions

void MHD_SHA256_init_one_time (struct Sha256CtxExt *ctx)
 
void MHD_SHA256_update (struct Sha256CtxExt *ctx, const uint8_t *data, size_t length)
 
void MHD_SHA256_finish_reset (struct Sha256CtxExt *ctx, uint8_t digest[SHA256_DIGEST_SIZE])
 
void MHD_SHA256_deinit (struct Sha256CtxExt *ctx)
 

Function Documentation

◆ MHD_SHA256_deinit()

void MHD_SHA256_deinit ( struct Sha256CtxExt * ctx)

Free allocated resources.

Parameters
ctxthe calculation context

Definition at line 97 of file sha256_ext.c.

References Sha256CtxExt::handle, and NULL.

◆ MHD_SHA256_finish_reset()

void MHD_SHA256_finish_reset ( struct Sha256CtxExt * ctx,
uint8_t digest[SHA256_DIGEST_SIZE] )

Finalise SHA-256 calculation, return digest, reset hash calculation.

Parameters
ctxthe calculation context
[out]digestset to the hash, must be SHA256_DIGEST_SIZE bytes

Definition at line 83 of file sha256_ext.c.

References Sha256CtxExt::ext_error, Sha256CtxExt::handle, and SHA256_DIGEST_SIZE.

◆ MHD_SHA256_init_one_time()

void MHD_SHA256_init_one_time ( struct Sha256CtxExt * ctx)

Initialise structure for SHA-256 calculation, allocate resources.

This function must not be called more than one time for ctx.

Parameters
ctxthe calculation context

Definition at line 39 of file sha256_ext.c.

References Sha256CtxExt::ext_error, Sha256CtxExt::handle, mhd_assert, and NULL.

◆ MHD_SHA256_update()

void MHD_SHA256_update ( struct Sha256CtxExt * ctx,
const uint8_t * data,
size_t length )

Process portion of bytes.

Parameters
ctxthe calculation context
databytes to add to hash
lengthnumber of bytes in data

Definition at line 67 of file sha256_ext.c.

References data, Sha256CtxExt::ext_error, and Sha256CtxExt::handle.