libzpc 1.5
IBM Z Protected-key Crypto library
Loading...
Searching...
No Matches
aes_cbc.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_CBC_H
9# define ZPC_AES_CBC_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_cbc;
30
36__attribute__((visibility("default")))
37int zpc_aes_cbc_alloc(struct zpc_aes_cbc **ctx);
44__attribute__((visibility("default")))
45int zpc_aes_cbc_set_key(struct zpc_aes_cbc *ctx, struct zpc_aes_key *key);
53__attribute__((visibility("default")))
54int zpc_aes_cbc_set_iv(struct zpc_aes_cbc *ctx, const unsigned char *iv);
63__attribute__((visibility("default")))
64int zpc_aes_cbc_get_intermediate_iv(struct zpc_aes_cbc *ctx, unsigned char iv[16]);
73__attribute__((visibility("default")))
74int zpc_aes_cbc_set_intermediate_iv(struct zpc_aes_cbc *ctx, const unsigned char iv[16]);
83__attribute__((visibility("default")))
84int zpc_aes_cbc_encrypt(struct zpc_aes_cbc *ctx, unsigned char *ct,
85 const unsigned char *pt, size_t ptlen);
94__attribute__((visibility("default")))
95int zpc_aes_cbc_decrypt(struct zpc_aes_cbc *ctx, unsigned char *pt,
96 const unsigned char *ct, size_t ctlen);
101__attribute__((visibility("default")))
102void zpc_aes_cbc_free(struct zpc_aes_cbc **ctx);
103
104# ifdef __cplusplus
105/* *INDENT-OFF* */
106}
107/* *INDENT-ON* */
108# endif
109#endif
int zpc_aes_cbc_set_key(struct zpc_aes_cbc *ctx, struct zpc_aes_key *key)
int zpc_aes_cbc_encrypt(struct zpc_aes_cbc *ctx, unsigned char *ct, const unsigned char *pt, size_t ptlen)
int zpc_aes_cbc_alloc(struct zpc_aes_cbc **ctx)
int zpc_aes_cbc_set_iv(struct zpc_aes_cbc *ctx, const unsigned char *iv)
int zpc_aes_cbc_get_intermediate_iv(struct zpc_aes_cbc *ctx, unsigned char iv[16])
int zpc_aes_cbc_set_intermediate_iv(struct zpc_aes_cbc *ctx, const unsigned char iv[16])
void zpc_aes_cbc_free(struct zpc_aes_cbc **ctx)
int zpc_aes_cbc_decrypt(struct zpc_aes_cbc *ctx, unsigned char *pt, const unsigned char *ct, size_t ctlen)
AES key API.