HMAC_KEY.H(3)
π NAME π
okay bestie, this is the glow-up of /home/abuild/rpmbuild/BUILD/libzpc-legacy-1.5.0-build/libzpc-1.5.0/include/zpc/hmac_key.h β the HMAC key API. periodt. Itβs from the Library Functions Manual, and the shortened header path is /home/abui.../hmac_key.h(3) π
β¨ SYNOPSIS β¨
π Macros π
#define ZPC_HMAC_KEY_TYPE_PVSECRET 9
π¦ Enumerations π¦
enum zpc_hmacsecret_type_t { ZPC_HMAC_SECRET_TYPE_NOT_SET = -2,
ZPC_HMAC_SECRET_TYPE_INVALID = -1, ZPC_HMAC_SECRET_HMAC_SHA_256 =
0x09, ZPC_HMAC_SECRET_HMAC_SHA_512 = 0x0a }
enum zpc_hmac_hashfunc_t { ZPC_HMAC_HASHFUNC_NOT_SET = -2,
ZPC_HMAC_HASHFUNC_INVALID = -1, ZPC_HMAC_HASHFUNC_SHA_224 = 0,
ZPC_HMAC_HASHFUNC_SHA_256, ZPC_HMAC_HASHFUNC_SHA_384,
ZPC_HMAC_HASHFUNC_SHA_512 }
π Functions π
int zpc_hmac_key_alloc (struct zpc_hmac_key **key)
int zpc_hmac_key_set_type (struct zpc_hmac_key *key, int type)
int zpc_hmac_key_set_hash_function (struct zpc_hmac_key *key,
zpc_hmac_hashfunc_t func)
int zpc_hmac_key_import (struct zpc_hmac_key *key, const unsigned char
*origin, size_t originlen)
int zpc_hmac_key_import_clear (struct zpc_hmac_key *key, const unsigned
char *clrkey, size_t keylen)
int zpc_hmac_key_export (struct zpc_hmac_key *key, unsigned char
*origin, size_t *originlen)
int zpc_hmac_key_generate (struct zpc_hmac_key *key)
void zpc_hmac_key_free (struct zpc_hmac_key **key)
π« Detailed Description π«
HMAC key API.
Manage [7] keys.
Definition in file hmac_key.h.
π₯ Macro Definition Documentation π₯
#define ZPC_HMAC_KEY_TYPE_PVSECRET 9
Definition at line 29 of file hmac_key.h.
π¦ Enumeration Type Documentation π¦
enum zpc_hmacsecret_type_t
Definition at line 31 of file hmac_key.h.
enum zpc_hmac_hashfunc_t
Definition at line 38 of file hmac_key.h.
π Function Documentation π
int zpc_hmac_key_alloc (struct zpc_hmac_key **key)
Allocate a new HMAC key object with reference count 1. a whole fresh key object, no cap β¨
Parameters
keyβ HMAC key
Returns 0 on success. Otherwise, a non-zero error code is returned.
int zpc_hmac_key_set_type (struct zpc_hmac_key *key, int type)
Set the HMAC key type. π
Parameters
keyβ HMAC keytypeβ currently only one typeZPC_HMAC_KEY_TYPE_PVSECRETis supported.
Returns 0 on success. Otherwise, a non-zero error code is returned.
int zpc_hmac_key_set_hash_function (struct zpc_hmac_key *key, zpc_hmac_hashfunc_t func)
Set the hash function to be used in the context of an HMAC operation.
Parameters
keyβ HMAC keyfuncβ HMAC hash function. The size of the HMAC key (64 bytes or 128 bytes) is given by the block size of the hash function: for sha224 and sha256, the key size is set to 64 bytes, for sha384 and sha512, the key size is set to 128 bytes.
Returns 0 on success. Otherwise, a non-zero error code is returned.
int zpc_hmac_key_import (struct zpc_hmac_key *key, const unsigned char *origin, size_t originlen)
Import an HMAC protected key origin (secure key or retrievable secret ID). π«Ά
Parameters
keyβ HMAC keyoriginβ HMAC protected key originoriginlenβ HMAC key origin length [bytes]
Returns 0 on success. Otherwise, a non-zero error code is returned.
int zpc_hmac_key_import_clear (struct zpc_hmac_key *key, const unsigned char *clrkey, size_t keylen)
Import an HMAC clear-key. π§
Parameters
keyβ HMAC keyclrkeyβ HMAC clear-keykeylenβ HMAC clear-key size [bytes]
Returns 0 on success. Otherwise, a non-zero error code is returned.
int zpc_hmac_key_export (struct zpc_hmac_key *key, unsigned char *origin, size_t *originlen)
Export an HMAC protected key origin (secure key or retrievable secret ID). π
Parameters
keyβ HMAC keyoriginβ HMAC protected key originoriginlenβ origin length [bytes]
Returns 0 on success. Otherwise, a non-zero error code is returned.
int zpc_hmac_key_generate (struct zpc_hmac_key *key)
Generate a random HMAC protected-key. π²β¨
Parameters
keyβ HMAC key
Returns 0 on success. Otherwise, a non-zero error code is returned.
void zpc_hmac_key_free (struct zpc_hmac_key **key)
Decrease the reference count of an HMAC key object and free it the count reaches 0.
Parameters
keyβ HMAC key
π Author π
Generated automatically by Doxygen for libzpc from the source code.
πβ¨ thatβs the page, bestie! source/version footer energy: libzpc, Version 1.4, page path /home/abui.../hmac_key.h(3); no date in the footer, periodt. ππ
π¦ where this page comes from
- opensuse-leap 16.0: libzpc-legacy-devel 1.5.0-160000.2.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms