libzpc 1.5
IBM Z Protected-key Crypto library
Loading...
Searching...
No Matches
aes_cmac.h
Go to the documentation of this file.
1/*
2 * Copyright IBM Corp. 2021
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_AES_CMAC_H
9# define ZPC_AES_CMAC_H
10# ifdef __cplusplus
11/* *INDENT-OFF* */
12extern "C" {
13/* *INDENT-ON* */
14# endif
15
25
26# include <zpc/aes_key.h>
27# include <stddef.h>
28
29struct zpc_aes_cmac;
30
36__attribute__((visibility("default")))
37int zpc_aes_cmac_alloc(struct zpc_aes_cmac **ctx);
44__attribute__((visibility("default")))
45int zpc_aes_cmac_set_key(struct zpc_aes_cmac *ctx, struct zpc_aes_key *key);
55__attribute__((visibility("default")))
56int zpc_aes_cmac_sign(struct zpc_aes_cmac *ctx, unsigned char *mac,
57 size_t maclen, const unsigned char *msg, size_t msglen);
67__attribute__((visibility("default")))
68int zpc_aes_cmac_verify(struct zpc_aes_cmac *ctx, const unsigned char *mac,
69 size_t maclen, const unsigned char *msg, size_t msglen);
74__attribute__((visibility("default")))
75void zpc_aes_cmac_free(struct zpc_aes_cmac **ctx);
76
77# ifdef __cplusplus
78/* *INDENT-OFF* */
79}
80/* *INDENT-ON* */
81# endif
82#endif
int zpc_aes_cmac_alloc(struct zpc_aes_cmac **ctx)
void zpc_aes_cmac_free(struct zpc_aes_cmac **ctx)
int zpc_aes_cmac_sign(struct zpc_aes_cmac *ctx, unsigned char *mac, size_t maclen, const unsigned char *msg, size_t msglen)
int zpc_aes_cmac_verify(struct zpc_aes_cmac *ctx, const unsigned char *mac, size_t maclen, const unsigned char *msg, size_t msglen)
int zpc_aes_cmac_set_key(struct zpc_aes_cmac *ctx, struct zpc_aes_key *key)
AES key API.