summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2019-03-18 05:56:24 +0000
committerschwarze <schwarze@openbsd.org>2019-03-18 05:56:24 +0000
commit79dafaae001ab7798fbac2f524215ef836c111cd (patch)
treec93450f91de849e0ebca819b9cf87d4391d2dc03
parentExpand the ERR_PACK() macro to ERR_REASON() for consistency. (diff)
downloadwireguard-openbsd-79dafaae001ab7798fbac2f524215ef836c111cd.tar.xz
wireguard-openbsd-79dafaae001ab7798fbac2f524215ef836c111cd.zip
Document SM4; related to evp.h rev. 1.73.
-rw-r--r--lib/libcrypto/man/EVP_EncryptInit.310
-rw-r--r--lib/libcrypto/man/EVP_sm4_cbc.381
-rw-r--r--lib/libcrypto/man/Makefile3
-rw-r--r--lib/libcrypto/man/evp.35
4 files changed, 93 insertions, 6 deletions
diff --git a/lib/libcrypto/man/EVP_EncryptInit.3 b/lib/libcrypto/man/EVP_EncryptInit.3
index c72db462e4a..704a2016ed6 100644
--- a/lib/libcrypto/man/EVP_EncryptInit.3
+++ b/lib/libcrypto/man/EVP_EncryptInit.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: EVP_EncryptInit.3,v 1.26 2019/03/10 21:31:49 jmc Exp $
+.\" $OpenBSD: EVP_EncryptInit.3,v 1.27 2019/03/18 05:56:24 schwarze Exp $
.\" full merge up to: OpenSSL 5211e094 Nov 11 14:39:11 2014 -0800
.\" selective merge up to: OpenSSL 16cfc2c9 Mar 8 22:30:28 2018 +0100
.\"
@@ -51,7 +51,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: March 10 2019 $
+.Dd $Mdocdate: March 18 2019 $
.Dt EVP_ENCRYPTINIT 3
.Os
.Sh NAME
@@ -1025,6 +1025,9 @@ correctly: see CCM mode section below for details.
The ChaCha20 stream cipher.
The key length is 256 bits, the IV is 96 bits long.
.El
+.Pp
+See also
+.Xr EVP_sm4_cbc 3 .
.Ss GCM mode
For GCM mode ciphers, the behaviour of the EVP interface
is subtly altered and several additional ctrl operations are
@@ -1227,7 +1230,8 @@ do_crypt(FILE *in, FILE *out, int do_encrypt)
}
.Ed
.Sh SEE ALSO
-.Xr evp 3
+.Xr evp 3 ,
+.Xr EVP_sm4_cbc 3
.Sh HISTORY
.Fn EVP_EncryptInit ,
.Fn EVP_EncryptUpdate ,
diff --git a/lib/libcrypto/man/EVP_sm4_cbc.3 b/lib/libcrypto/man/EVP_sm4_cbc.3
new file mode 100644
index 00000000000..85ff88f54e3
--- /dev/null
+++ b/lib/libcrypto/man/EVP_sm4_cbc.3
@@ -0,0 +1,81 @@
+.\" $OpenBSD: EVP_sm4_cbc.3,v 1.1 2019/03/18 05:56:24 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: March 18 2019 $
+.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 .
+.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 .
diff --git a/lib/libcrypto/man/Makefile b/lib/libcrypto/man/Makefile
index 5adaafe4ffa..79ada9713d1 100644
--- a/lib/libcrypto/man/Makefile
+++ b/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.143 2019/03/10 15:00:34 schwarze Exp $
+# $OpenBSD: Makefile,v 1.144 2019/03/18 05:56:24 schwarze Exp $
.include <bsd.own.mk>
@@ -151,6 +151,7 @@ MAN= \
EVP_SealInit.3 \
EVP_SignInit.3 \
EVP_VerifyInit.3 \
+ EVP_sm4_cbc.3 \
EXTENDED_KEY_USAGE_new.3 \
GENERAL_NAME_new.3 \
HMAC.3 \
diff --git a/lib/libcrypto/man/evp.3 b/lib/libcrypto/man/evp.3
index 085db2eb6e4..a5a2a491645 100644
--- a/lib/libcrypto/man/evp.3
+++ b/lib/libcrypto/man/evp.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: evp.3,v 1.5 2018/04/18 01:12:11 schwarze Exp $
+.\" $OpenBSD: evp.3,v 1.6 2019/03/18 05:56:24 schwarze Exp $
.\" OpenSSL a9c85cea Nov 11 09:33:55 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>,
@@ -51,7 +51,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: April 18 2018 $
+.Dd $Mdocdate: March 18 2019 $
.Dt EVP 3
.Os
.Sh NAME
@@ -199,5 +199,6 @@ operations are more efficient using the high level interfaces.
.Xr EVP_PKEY_verify_recover 3 ,
.Xr EVP_SealInit 3 ,
.Xr EVP_SignInit 3 ,
+.Xr EVP_sm4_cbc 3 ,
.Xr EVP_VerifyInit 3 ,
.Xr OpenSSL_add_all_algorithms 3