Scroll to navigation

libhmac(3) Library Functions Manual libhmac(3)

NAME

libhmac.hLibrary 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 context functions
int
libhmac_md5_context_initialize(libhmac_md5_context_t **context, libhmac_error_t **error);

int
libhmac_md5_context_free(libhmac_md5_context_t **context, libhmac_error_t **error);

int
libhmac_md5_context_update(libhmac_md5_context_t *context, const uint8_t *buffer, size_t size, libhmac_error_t **error);

int
libhmac_md5_context_finalize(libhmac_md5_context_t *context, uint8_t *hash, size_t hash_size, libhmac_error_t **error);

MD5 functions
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 context functions
int
libhmac_sha1_context_initialize(libhmac_sha1_context_t **context, libhmac_error_t **error);

int
libhmac_sha1_context_free(libhmac_sha1_context_t **context, libhmac_error_t **error);

int
libhmac_sha1_context_update(libhmac_sha1_context_t *context, const uint8_t *buffer, size_t size, libhmac_error_t **error);

int
libhmac_sha1_context_finalize(libhmac_sha1_context_t *context, uint8_t *hash, size_t hash_size, libhmac_error_t **error);

SHA1 functions
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 context functions
int
libhmac_sha224_context_initialize(libhmac_sha224_context_t **context, libhmac_error_t **error);

int
libhmac_sha224_context_free(libhmac_sha224_context_t **context, libhmac_error_t **error);

int
libhmac_sha224_context_update(libhmac_sha224_context_t *context, const uint8_t *buffer, size_t size, libhmac_error_t **error);

int
libhmac_sha224_context_finalize(libhmac_sha224_context_t *context, uint8_t *hash, size_t hash_size, libhmac_error_t **error);

SHA-224 functions
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 context functions
int
libhmac_sha256_context_initialize(libhmac_sha256_context_t **context, libhmac_error_t **error);

int
libhmac_sha256_context_free(libhmac_sha256_context_t **context, libhmac_error_t **error);

int
libhmac_sha256_context_update(libhmac_sha256_context_t *context, const uint8_t *buffer, size_t size, libhmac_error_t **error);

int
libhmac_sha256_context_finalize(libhmac_sha256_context_t *context, uint8_t *hash, size_t hash_size, libhmac_error_t **error);

SHA-256 functions
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 context functions
int
libhmac_sha512_context_initialize(libhmac_sha512_context_t **context, libhmac_error_t **error);

int
libhmac_sha512_context_free(libhmac_sha512_context_t **context, libhmac_error_t **error);

int
libhmac_sha512_context_update(libhmac_sha512_context_t *context, const uint8_t *buffer, size_t size, libhmac_error_t **error);

int
libhmac_sha512_context_finalize(libhmac_sha512_context_t *context, uint8_t *hash, size_t hash_size, libhmac_error_t **error);

SHA-512 functions
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 () 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-2024, 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

April 7, 2023 libhmac