GNU libmicrohttpd 1.0.0
|
Wrapper for SHA-256 calculation performed by TLS library. More...
Go to the source code of this file.
Data Structures | |
struct | Sha256CtxExt |
Macros | |
#define | SHA256_DIGEST_SIZE (32) |
#define | MHD_SHA256_HAS_EXT_ERROR 1 |
#define | MHD_SHA256_HAS_INIT_ONE_TIME 1 |
#define | MHD_SHA256_HAS_FINISH_RESET 1 |
#define | MHD_SHA256_HAS_DEINIT 1 |
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) |
Wrapper for SHA-256 calculation performed by TLS library.
Wrapper declarations for SHA-256 calculation performed by TLS library.
Definition in file sha256_ext.h.
#define MHD_SHA256_HAS_DEINIT 1 |
Indicates that MHD_SHA256_deinit() function is present
Definition at line 105 of file sha256_ext.h.
#define MHD_SHA256_HAS_EXT_ERROR 1 |
Indicates that struct Sha256CtxExt has 'ext_error'
Definition at line 47 of file sha256_ext.h.
#define MHD_SHA256_HAS_FINISH_RESET 1 |
Indicates that MHD_SHA256_finish_reset() function is available
Definition at line 90 of file sha256_ext.h.
#define MHD_SHA256_HAS_INIT_ONE_TIME 1 |
Indicates that MHD_SHA256_init_one_time() function is present.
Definition at line 61 of file sha256_ext.h.
#define SHA256_DIGEST_SIZE (32) |
Size of SHA-256 resulting digest in bytes This is the final digest size, not intermediate hash.
Definition at line 39 of file sha256_ext.h.
void MHD_SHA256_deinit | ( | struct Sha256CtxExt * | ctx | ) |
Free allocated resources.
ctx | the calculation context |
Definition at line 97 of file sha256_ext.c.
References Sha256CtxExt::handle, and NULL.
void MHD_SHA256_finish_reset | ( | struct Sha256CtxExt * | ctx, |
uint8_t | digest[SHA256_DIGEST_SIZE] | ||
) |
Finalise SHA-256 calculation, return digest, reset hash calculation.
ctx | the calculation context | |
[out] | digest | set to the hash, must be SHA256_DIGEST_SIZE bytes |
Definition at line 83 of file sha256_ext.c.
References Sha256CtxExt::ext_error, and Sha256CtxExt::handle.
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.
ctx | the calculation context |
Definition at line 39 of file sha256_ext.c.
References Sha256CtxExt::ext_error, Sha256CtxExt::handle, mhd_assert, and NULL.
void MHD_SHA256_update | ( | struct Sha256CtxExt * | ctx, |
const uint8_t * | data, | ||
size_t | length | ||
) |
SHA-256 process portion of bytes.
ctx | the calculation context |
data | bytes to add to hash |
length | number of bytes in data |
Process portion of bytes.
ctx | the calculation context |
data | bytes to add to hash |
length | number of bytes in data |
Definition at line 67 of file sha256_ext.c.
References data, Sha256CtxExt::ext_error, and Sha256CtxExt::handle.