libhmac(3)

NAME
libhmac.h - Library to support various Hash-based Message Authentication Codes (HMAC)

SYNOPSIS
#include <libhmac.h>

Support functions
const char *
libhmac_get_version(void);

Error functions
void
libhmac_error_free(libhmac_error_t **error);
int
libhmac_error_fprint(libhmac_error_t *error, FILE *stream);
int
libhmac_error_sprint(libhmac_error_t *error, char *string, size_t size);
int
libhmac_error_backtrace_fprint(libhmac_error_t *error, FILE *stream);
int
libhmac_error_backtrace_sprint(libhmac_error_t *error, char *string, size_t size);

MD5 functions
int
libhmac_md5_initialize(libhmac_md5_context_t **context, libhmac_error_t **error);
int
libhmac_md5_free(libhmac_md5_context_t **context, libhmac_error_t **error);
int
libhmac_md5_update(libhmac_md5_context_t *context, const uint8_t *buffer, size_t size, libhmac_error_t **error);
int
libhmac_md5_finalize(libhmac_md5_context_t *context, uint8_t *hash, size_t hash_size, libhmac_error_t **error);
int
libhmac_md5_calculate(const uint8_t *buffer, size_t size, uint8_t *hash, size_t hash_size, libhmac_error_t **error);
int
libhmac_md5_calculate_hmac(const uint8_t *key, size_t key_size, const uint8_t *buffer, size_t size, uint8_t *hmac, size_t hmac_size, libhmac_error_t **error);

SHA1 functions
int
libhmac_sha1_initialize(libhmac_sha1_context_t **context, libhmac_error_t **error);
int
libhmac_sha1_free(libhmac_sha1_context_t **context, libhmac_error_t **error);
int
libhmac_sha1_update(libhmac_sha1_context_t *context, const uint8_t *buffer, size_t size, libhmac_error_t **error);
int
libhmac_sha1_finalize(libhmac_sha1_context_t *context, uint8_t *hash, size_t hash_size, libhmac_error_t **error);
int
libhmac_sha1_calculate(const uint8_t *buffer, size_t size, uint8_t *hash, size_t hash_size, libhmac_error_t **error);
int
libhmac_sha1_calculate_hmac(const uint8_t *key, size_t key_size, const uint8_t *buffer, size_t size, uint8_t *hmac, size_t hmac_size, libhmac_error_t **error);

SHA-224 functions
int
libhmac_sha224_initialize(libhmac_sha224_context_t **context, libhmac_error_t **error);
int
libhmac_sha224_free(libhmac_sha224_context_t **context, libhmac_error_t **error);
int
libhmac_sha224_update(libhmac_sha224_context_t *context, const uint8_t *buffer, size_t size, libhmac_error_t **error);
int
libhmac_sha224_finalize(libhmac_sha224_context_t *context, uint8_t *hash, size_t hash_size, libhmac_error_t **error);
int
libhmac_sha224_calculate(const uint8_t *buffer, size_t size, uint8_t *hash, size_t hash_size, libhmac_error_t **error);
int
libhmac_sha224_calculate_hmac(const uint8_t *key, size_t key_size, const uint8_t *buffer, size_t size, uint8_t *hmac, size_t hmac_size, libhmac_error_t **error);

SHA-256 functions
int
libhmac_sha256_initialize(libhmac_sha256_context_t **context, libhmac_error_t **error);
int
libhmac_sha256_free(libhmac_sha256_context_t **context, libhmac_error_t **error);
int
libhmac_sha256_update(libhmac_sha256_context_t *context, const uint8_t *buffer, size_t size, libhmac_error_t **error);
int
libhmac_sha256_finalize(libhmac_sha256_context_t *context, uint8_t *hash, size_t hash_size, libhmac_error_t **error);
int
libhmac_sha256_calculate(const uint8_t *buffer, size_t size, uint8_t *hash, size_t hash_size, libhmac_error_t **error);
int
libhmac_sha256_calculate_hmac(const uint8_t *key, size_t key_size, const uint8_t *buffer, size_t size, uint8_t *hmac, size_t hmac_size, libhmac_error_t **error);

SHA-512 functions
int
libhmac_sha512_initialize(libhmac_sha512_context_t **context, libhmac_error_t **error);
int
libhmac_sha512_free(libhmac_sha512_context_t **context, libhmac_error_t **error);
int
libhmac_sha512_update(libhmac_sha512_context_t *context, const uint8_t *buffer, size_t size, libhmac_error_t **error);
int
libhmac_sha512_finalize(libhmac_sha512_context_t *context, uint8_t *hash, size_t hash_size, libhmac_error_t **error);
int
libhmac_sha512_calculate(const uint8_t *buffer, size_t size, uint8_t *hash, size_t hash_size, libhmac_error_t **error);
int
libhmac_sha512_calculate_hmac(const uint8_t *key, size_t key_size, const uint8_t *buffer, size_t size, uint8_t *hmac, size_t hmac_size, libhmac_error_t **error);

DESCRIPTION
The libhmac_get_version() function is used to retrieve the library version.

RETURN VALUES
Most of the functions return NULL or -1 on error, dependent on the return type. For the actual return values see "libhmac.h".

ENVIRONMENT
None

FILES
None

BUGS
Please report bugs of any kind on the project issue tracker: https://github.com/libyal/libhmac/issues

AUTHOR
These man pages are generated from "libhmac.h".

COPYRIGHT
Copyright (C) 2011-2023, Joachim Metz <joachim.metz@gmail.com>.

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

SEE ALSO
the libhmac.h include file