1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
.\" $OpenBSD: EVP_sm4_cbc.3,v 1.2 2023/11/16 20:27:43 schwarze Exp $
.\" full merge up to: OpenSSL 87103969 Oct 1 14:11:57 2018 -0700
.\"
.\" Copyright (c) 2017 Ribose Inc
.\" Copyright (c) 2019 Ingo Schwarze <schwarze@openbsd.org>
.\" The original version of this file
.\" was written by Ronald Tse <ronald.tse@ribose.com>.
.\"
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: November 16 2023 $
.Dt EVP_SM4_CBC 3
.Os
.Sh NAME
.Nm EVP_sm4_cbc ,
.Nm EVP_sm4_ecb ,
.Nm EVP_sm4_cfb ,
.Nm EVP_sm4_cfb128 ,
.Nm EVP_sm4_ofb ,
.Nm EVP_sm4_ctr
.Nd EVP SM4 cipher
.Sh SYNOPSIS
.In openssl/evp.h
.Ft const EVP_CIPHER *
.Fn EVP_sm4_cbc void
.Ft const EVP_CIPHER *
.Fn EVP_sm4_ecb void
.Ft const EVP_CIPHER *
.Fn EVP_sm4_cfb void
.Ft const EVP_CIPHER *
.Fn EVP_sm4_cfb128 void
.Ft const EVP_CIPHER *
.Fn EVP_sm4_ofb void
.Ft const EVP_CIPHER *
.Fn EVP_sm4_ctr void
.Sh DESCRIPTION
These functions provide the SM4 blockcipher in the
.Xr evp 3
framework.
.Pp
All modes use a key length of 128 bits and act on blocks of 128
bits.
.Pp
.Fn EVP_sm4_cfb
is an alias for
.Fn EVP_sm4_cfb128 ,
implemented as a macro.
.Pp
With an argument of
.Qq sm4
or
.Qq SM4 ,
.Xr EVP_get_cipherbyname 3
returns
.Fn EVP_sm4_cbc .
.Sh RETURN VALUES
These functions return an
.Vt EVP_CIPHER
structure that provides the implementation of the symmetric cipher.
.Sh SEE ALSO
.Xr evp 3 ,
.Xr EVP_EncryptInit 3
.Sh STANDARDS
.Rs
.%T Information security technology - SM4 block cipher algorithm
.%I National Standards of People's Republic of China
.%N GB/T 32907-2016
.%D August 29, 2016
.Re
.Sh HISTORY
These functions appeared in OpenSSL 1.1.1 and have been available since
.Ox 6.5 .
|