]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
doc: add note for sm4 xts
authorXu Yizhou <xuyizhou1@huawei.com>
Fri, 25 Nov 2022 05:57:37 +0000 (13:57 +0800)
committerTomas Mraz <tomas@openssl.org>
Tue, 29 Nov 2022 15:18:07 +0000 (16:18 +0100)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19619)

doc/man3/EVP_EncryptInit.pod
doc/man7/EVP_CIPHER-SM4.pod

index 1fa31d3f5322d18c70cb9a965d0ef6e46b6187f5..dafa71c9f66e080ffe9cb3d9537d666cb19126a6 100644 (file)
@@ -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
index 36a51d18a4238a8d09d75dccff11cf14a5413c2b..b0c292757e77f166e6f3f65848db7de2b61a3a5f 100644 (file)
@@ -24,6 +24,12 @@ The following algorithms are available in the default provider:
 
 =item "SM4-CFB" or "SM4-CFB128"
 
+=item "SM4-GCM"
+
+=item "SM4-CCM"
+
+=item "SM4-XTS"
+
 =back
 
 =head2 Parameters