Skip to content

Commit

Permalink
doc: add note for sm4 xts
Browse files Browse the repository at this point in the history
  • Loading branch information
xu-yi-zhou committed Nov 8, 2022
1 parent a7c5e43 commit e3ffdb6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions doc/man3/EVP_EncryptInit.pod
Expand Up @@ -993,6 +993,26 @@ 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>) <integer>

Sets the XTS standard. 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.

By default, XTS mode of the SM4 algorithm is specified by GB/T
17964-2021.

=back

=head1 CONTROLS
Expand Down
6 changes: 6 additions & 0 deletions doc/man7/EVP_CIPHER-SM4.pod
Expand Up @@ -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
Expand Down

0 comments on commit e3ffdb6

Please sign in to comment.