summaryrefslogtreecommitdiffstats
path: root/doc/man3/EVP_EncryptInit.pod
diff options
context:
space:
mode:
authorXu Yizhou <xuyizhou1@huawei.com>2022-11-25 13:57:37 +0800
committerTomas Mraz <tomas@openssl.org>2022-11-29 16:18:07 +0100
commite44b34185268e99ee2dc499073cf56d0465d60e2 (patch)
treea8f25c55ee7670fb5ab6e7fca10d216296b38b01 /doc/man3/EVP_EncryptInit.pod
parent6cdf83eaabda63f7c5cf9d69d51d931308da471e (diff)
doc: add note for sm4 xts
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 'doc/man3/EVP_EncryptInit.pod')
-rw-r--r--doc/man3/EVP_EncryptInit.pod34
1 files changed, 34 insertions, 0 deletions
diff --git a/doc/man3/EVP_EncryptInit.pod b/doc/man3/EVP_EncryptInit.pod
index 1fa31d3f53..dafa71c9f6 100644
--- a/doc/man3/EVP_EncryptInit.pod
+++ b/doc/man3/EVP_EncryptInit.pod
@@ -993,6 +993,40 @@ Byte 11-12: Input length (Always 0)
"tls1multi_interleave" must also be set for this operation.
+=item "xts_standard" (B<OSSL_CIPHER_PARAM_XTS_STANDARD>) <UTF8 string>
+
+Sets the XTS standard to use with SM4-XTS algorithm. XTS mode has two
+implementations, one is standardized in IEEE Std. 1619-2007 and has
+been widely used (e.g., XTS AES), the other is proposed recently
+(GB/T 17964-2021 implemented in May 2022) and is currently only used
+in SM4.
+
+The main difference between them is the multiplication by the
+primitive element E<alpha> to calculate the tweak values. The IEEE
+Std 1619-2007 noted that the multiplication "is a left shift of each
+byte by one bit with carry propagating from one byte to the next
+one", which means that in each byte, the leftmost bit is the most
+significant bit. But in GB/T 17964-2021, the rightmost bit is the
+most significant bit, thus the multiplication becomes a right shift
+of each byte by one bit with carry propagating from one byte to the
+next one.
+
+Valid values for the mode are:
+
+=over 4
+
+=item "GB"
+
+The GB/T 17964-2021 variant of SM4-XTS algorithm.
+
+=item "IEEE"
+
+The IEEE Std. 1619-2007 variant of SM4-XTS algorithm.
+
+=back
+
+The default value is "GB".
+
=back
=head1 CONTROLS