summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorXu Yizhou <xuyizhou1@huawei.com>2022-11-25 13:52:49 +0800
committerTomas Mraz <tomas@openssl.org>2022-11-29 16:17:30 +0100
commit2788b56f0c8306c89c97a6599484120afddfa14a (patch)
tree0b682cc46d94138ad342681b3fd7a2f7aaafd948 /include
parentde8f6a3e293a43f364cddefdf734b13486ec4cc9 (diff)
providers: Add SM4 XTS implementation
Signed-off-by: Xu Yizhou <xuyizhou1@huawei.com> Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19619)
Diffstat (limited to 'include')
-rw-r--r--include/crypto/modes.h6
-rw-r--r--include/openssl/core_names.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/include/crypto/modes.h b/include/crypto/modes.h
index d567a0ba84..d03ca83d00 100644
--- a/include/crypto/modes.h
+++ b/include/crypto/modes.h
@@ -155,6 +155,12 @@ struct xts128_context {
block128_f block1, block2;
};
+/* XTS mode for SM4 algorithm specified by GB/T 17964-2021 */
+int ossl_crypto_xts128gb_encrypt(const XTS128_CONTEXT *ctx,
+ const unsigned char iv[16],
+ const unsigned char *inp, unsigned char *out,
+ size_t len, int enc);
+
struct ccm128_context {
union {
u64 u[2];
diff --git a/include/openssl/core_names.h b/include/openssl/core_names.h
index d0b9c37bc5..7b864483ac 100644
--- a/include/openssl/core_names.h
+++ b/include/openssl/core_names.h
@@ -97,6 +97,7 @@ extern "C" {
#define OSSL_CIPHER_PARAM_CTS_MODE "cts_mode" /* utf8_string */
/* For passing the AlgorithmIdentifier parameter in DER form */
#define OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS "alg_id_param" /* octet_string */
+#define OSSL_CIPHER_PARAM_XTS_STANDARD "xts_standard" /* utf8_string */
#define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_SEND_FRAGMENT \
"tls1multi_maxsndfrag" /* uint */