]> git.ipfire.org Git - thirdparty/openssl.git/blame - providers/common/ciphers/cipher_aes_xts.h
Add aes_xts cipher to providers
[thirdparty/openssl.git] / providers / common / ciphers / cipher_aes_xts.h
CommitLineData
3a9f26f3
SL
1/*
2 * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#include <openssl/aes.h>
11#include "internal/ciphers/ciphercommon.h"
12
13PROV_CIPHER_FUNC(void, xts_stream,
14 (const unsigned char *in, unsigned char *out, size_t len,
15 const AES_KEY *key1, const AES_KEY *key2,
16 const unsigned char iv[16]));
17
18typedef struct prov_aes_xts_ctx_st {
19 PROV_CIPHER_CTX base; /* Must be first */
20 union {
21 OSSL_UNION_ALIGN;
22 AES_KEY ks;
23 } ks1, ks2; /* AES key schedules to use */
24 XTS128_CONTEXT xts;
25 OSSL_xts_stream_fn stream;
26 unsigned int iv_set : 1; /* Set if an iv is set */
27} PROV_AES_XTS_CTX;
28
29const PROV_CIPHER_HW *PROV_CIPHER_HW_aes_xts(size_t keybits);