|
libzpc 1.5
IBM Z Protected-key Crypto library
|
HMAC API. More...
Go to the source code of this file.
Functions | |
| int | zpc_hmac_alloc (struct zpc_hmac **ctx) |
| int | zpc_hmac_set_key (struct zpc_hmac *ctx, struct zpc_hmac_key *key) |
| int | zpc_hmac_sign (struct zpc_hmac *ctx, unsigned char *mac, size_t maclen, const unsigned char *msg, size_t msglen) |
| int | zpc_hmac_verify (struct zpc_hmac *ctx, const unsigned char *mac, size_t maclen, const unsigned char *msg, size_t msglen) |
| void | zpc_hmac_free (struct zpc_hmac **ctx) |
HMAC API.
Message authentication API for the Hash-based Message Authentication Code (HMAC).
Definition in file hmac.h.
| int zpc_hmac_alloc | ( | struct zpc_hmac ** | ctx | ) |
Allocate a new context for an HMAC operation.
| [in,out] | ctx | HMAC context |
| int zpc_hmac_set_key | ( | struct zpc_hmac * | ctx, |
| struct zpc_hmac_key * | key ) |
Set the key to be used in the context of an HMAC operation.
| [in,out] | ctx | HMAC context |
| [in] | key | HMAC key |
| int zpc_hmac_sign | ( | struct zpc_hmac * | ctx, |
| unsigned char * | mac, | ||
| size_t | maclen, | ||
| const unsigned char * | msg, | ||
| size_t | msglen ) |
Do an HMAC signing operation.
| [in,out] | ctx | HMAC context |
| [in,out] | mac | message authentication code when set to NULL, this indicates that an internal intermediate MAC is calculated and further intermediate calls with additional msg data may follow. If the mac parm is not NULL and the maclen is a valid MAC length (dependent on the underlying hash function of the key) the final MAC is computed. |
| [in] | maclen | message authentication code length [bytes] |
| [in] | msg | message |
| [in] | msglen | message length [bytes] |
| int zpc_hmac_verify | ( | struct zpc_hmac * | ctx, |
| const unsigned char * | mac, | ||
| size_t | maclen, | ||
| const unsigned char * | msg, | ||
| size_t | msglen ) |
Do an HMAC verify operation.
| [in,out] | ctx | HMAC context |
| [in,out] | mac | message authentication code if the mac parm is NULL, then an intermediate verify op is performed. If the mac parm is not NULL and the maclen is a valid MAC length (dependent on the underlying hash function of the key), then the given MAC is checked for correctness. |
| [in] | maclen | message authentication code length [bytes] |
| [in] | msg | message |
| [in] | msglen | message length [bytes] |
| void zpc_hmac_free | ( | struct zpc_hmac ** | ctx | ) |
Free an HMAC context.
| [in,out] | ctx | HMAC context |