libzpc 1.5
IBM Z Protected-key Crypto library
Loading...
Searching...
No Matches
aes_ccm.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_CCM_H
9# define ZPC_AES_CCM_H
10# ifdef __cplusplus
11/* *INDENT-OFF* */
12extern "C" {
13/* *INDENT-ON* */
14# endif
15
24
25# include <zpc/aes_key.h>
26# include <stddef.h>
27
28struct zpc_aes_ccm;
29
35__attribute__((visibility("default")))
36int zpc_aes_ccm_alloc(struct zpc_aes_ccm **ctx);
43__attribute__((visibility("default")))
44int zpc_aes_ccm_set_key(struct zpc_aes_ccm *ctx, struct zpc_aes_key *key);
53__attribute__((visibility("default")))
54int zpc_aes_ccm_set_iv(struct zpc_aes_ccm *ctx, const unsigned char *iv,
55 size_t ivlen);
68__attribute__((visibility("default")))
69int zpc_aes_ccm_encrypt(struct zpc_aes_ccm *ctx, unsigned char *ct,
70 unsigned char *mac, size_t maclen, const unsigned char *aad, size_t aadlen,
71 const unsigned char *pt, size_t ptlen);
84__attribute__((visibility("default")))
85int zpc_aes_ccm_decrypt(struct zpc_aes_ccm *ctx, unsigned char *pt,
86 const unsigned char *mac, size_t maclen, const unsigned char *aad,
87 size_t aadlen, const unsigned char *ct, size_t ctlen);
92__attribute__((visibility("default")))
93void zpc_aes_ccm_free(struct zpc_aes_ccm **ctx);
94
95# ifdef __cplusplus
96/* *INDENT-OFF* */
97}
98/* *INDENT-ON* */
99# endif
100#endif
void zpc_aes_ccm_free(struct zpc_aes_ccm **ctx)
int zpc_aes_ccm_encrypt(struct zpc_aes_ccm *ctx, unsigned char *ct, unsigned char *mac, size_t maclen, const unsigned char *aad, size_t aadlen, const unsigned char *pt, size_t ptlen)
int zpc_aes_ccm_alloc(struct zpc_aes_ccm **ctx)
int zpc_aes_ccm_set_iv(struct zpc_aes_ccm *ctx, const unsigned char *iv, size_t ivlen)
int zpc_aes_ccm_set_key(struct zpc_aes_ccm *ctx, struct zpc_aes_key *key)
int zpc_aes_ccm_decrypt(struct zpc_aes_ccm *ctx, unsigned char *pt, const unsigned char *mac, size_t maclen, const unsigned char *aad, size_t aadlen, const unsigned char *ct, size_t ctlen)
AES key API.