libzpc 1.5
IBM Z Protected-key Crypto library
Loading...
Searching...
No Matches
aes_xts.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_XTS_H
9# define ZPC_AES_XTS_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_xts;
30
36__attribute__((visibility("default")))
37int zpc_aes_xts_alloc(struct zpc_aes_xts **ctx);
45__attribute__((visibility("default")))
46int zpc_aes_xts_set_key(struct zpc_aes_xts *ctx, struct zpc_aes_key *key1,
47 struct zpc_aes_key *key2);
55__attribute__((visibility("default")))
56int zpc_aes_xts_set_iv(struct zpc_aes_xts *ctx, const unsigned char *iv);
65__attribute__((visibility("default")))
66int zpc_aes_xts_get_intermediate_iv(struct zpc_aes_xts *ctx, unsigned char iv[16]);
75__attribute__((visibility("default")))
76int zpc_aes_xts_set_intermediate_iv(struct zpc_aes_xts *ctx, const unsigned char iv[16]);
85__attribute__((visibility("default")))
86int zpc_aes_xts_encrypt(struct zpc_aes_xts *ctx, unsigned char *ct,
87 const unsigned char *pt, size_t ptlen);
96__attribute__((visibility("default")))
97int zpc_aes_xts_decrypt(struct zpc_aes_xts *ctx, unsigned char *pt,
98 const unsigned char *ct, size_t ctlen);
103__attribute__((visibility("default")))
104void zpc_aes_xts_free(struct zpc_aes_xts **ctx);
105
106# ifdef __cplusplus
107/* *INDENT-OFF* */
108}
109/* *INDENT-ON* */
110# endif
111#endif
AES key API.
int zpc_aes_xts_encrypt(struct zpc_aes_xts *ctx, unsigned char *ct, const unsigned char *pt, size_t ptlen)
int zpc_aes_xts_get_intermediate_iv(struct zpc_aes_xts *ctx, unsigned char iv[16])
void zpc_aes_xts_free(struct zpc_aes_xts **ctx)
int zpc_aes_xts_set_key(struct zpc_aes_xts *ctx, struct zpc_aes_key *key1, struct zpc_aes_key *key2)
int zpc_aes_xts_set_iv(struct zpc_aes_xts *ctx, const unsigned char *iv)
int zpc_aes_xts_decrypt(struct zpc_aes_xts *ctx, unsigned char *pt, const unsigned char *ct, size_t ctlen)
int zpc_aes_xts_set_intermediate_iv(struct zpc_aes_xts *ctx, const unsigned char iv[16])
int zpc_aes_xts_alloc(struct zpc_aes_xts **ctx)