libzpc 1.5
IBM Z Protected-key Crypto library
Loading...
Searching...
No Matches
hmac.h
Go to the documentation of this file.
1/*
2 * Copyright IBM Corp. 2025
3 *
4 * libzpc is free software; you can redistribute it and/or modify
5 * it under the terms of the MIT license. See LICENSE for details.
6 */
7
8#ifndef ZPC_HMAC_H
9# define ZPC_HMAC_H
10# ifdef __cplusplus
11/* *INDENT-OFF* */
12extern "C" {
13/* *INDENT-ON* */
14# endif
15
24
25# include <zpc/hmac_key.h>
26# include <stddef.h>
27
28struct zpc_hmac;
29
35__attribute__((visibility("default")))
36int zpc_hmac_alloc(struct zpc_hmac **ctx);
43__attribute__((visibility("default")))
44int zpc_hmac_set_key(struct zpc_hmac *ctx, struct zpc_hmac_key *key);
58__attribute__((visibility("default")))
59int zpc_hmac_sign(struct zpc_hmac *ctx, unsigned char *mac,
60 size_t maclen, const unsigned char *msg, size_t msglen);
73__attribute__((visibility("default")))
74int zpc_hmac_verify(struct zpc_hmac *ctx, const unsigned char *mac,
75 size_t maclen, const unsigned char *msg, size_t msglen);
80__attribute__((visibility("default")))
81void zpc_hmac_free(struct zpc_hmac **ctx);
82
83# ifdef __cplusplus
84/* *INDENT-OFF* */
85}
86/* *INDENT-ON* */
87# endif
88#endif
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 key API.