2 * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
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
10 #include <crypto/sm4.h>
11 #include "prov/ciphercommon.h"
12 #include "crypto/sm4_platform.h"
14 PROV_CIPHER_FUNC(void, xts_stream
,
15 (const unsigned char *in
, unsigned char *out
, size_t len
,
16 const SM4_KEY
*key1
, const SM4_KEY
*key2
,
17 const unsigned char iv
[16], const int enc
));
19 typedef struct prov_sm4_xts_ctx_st
{
23 /* SM4 key schedules to use */
30 * XTS standard to use with SM4-XTS algorithm
33 * 0 for XTS mode specified by GB/T 17964-2021
34 * 1 for XTS mode specified by IEEE Std 1619-2007
40 /* Stream function for XTS mode specified by GB/T 17964-2021 */
41 OSSL_xts_stream_fn stream_gb
;
42 /* Stream function for XTS mode specified by IEEE Std 1619-2007 */
43 OSSL_xts_stream_fn stream
;
46 const PROV_CIPHER_HW
*ossl_prov_cipher_hw_sm4_xts(size_t keybits
);