xref: /netbsd-src/share/man/man4/man4.evbarm/sun8icrypto.4 (revision eda596189cb42a20070f2ce340f6917521f62c7a)
1.\" $NetBSD: sun8icrypto.4,v 1.2 2021/04/28 16:57:05 bad Exp $
2.\"
3.\" Copyright (c) 2021 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25.\" POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd April 28, 2021
28.Dt SUN8ICRYPTO 4
29.Os
30.Sh NAME
31.Nm sun8icrypto
32.Nd driver for Allwinner Crypto Engine
33.Sh SYNOPSIS
34.Cd "sun8icrypto* at fdt?"
35.Sh DESCRIPTION
36The
37.Nm
38driver provides support for the cryptographic processors on Allwinner
39A64, H3 and H5 systems-on-a-chip.
40The Allwinner Crypto Engine is the successor to the earlier
41Allwinner Security System.
42.Pp
43The hardware includes a True Random Number Generator (TRNG) that is
44used as an entropy source for the
45.Xr rnd 4
46system, and implementations of various cryptographic algorithms
47that can be used with
48.Xr ipsec 4
49and
50.Xr crypto 4 .
51.Pp
52The following
53.Xr opencrypto 9
54algorithms are supported:
55.Pp
56.Bl -bullet -compact -offset indent
57.It
58.Dv CRYPTO_AES_CBC
59.It
60.Dv CRYPTO_AES_CTR
61.It
62.Dv CRYPTO_AES_ECB
63.It
64.Dv CRYPTO_AES_XTS
65.It
66.Dv CRYPTO_DES_CBC
67.It
68.Dv CRYPTO_DES_ECB
69.It
70.Dv CRYPTO_3DES_CBC
71.It
72.Dv CRYPTO_3DES_ECB
73.It
74.Dv CRYPTO_MD5
75.It
76.Dv CRYPTO_SHA1
77.It
78.Dv CRYPTO_SHA224
79.It
80.Dv CRYPTO_SHA256
81.It
82.Dv CRYPTO_SHA1_HMAC
83.It
84.Dv CRYPTO_SHA2_256_HMAC
85.El
86.Sh SEE ALSO
87.Xr crypto 4 ,
88.Xr ipsec 4 ,
89.Xr rnd 4 ,
90.Xr entropy 7 ,
91.Xr opencrypto 9
92.Sh HISTORY
93The
94.Nm
95device driver first appeared in
96.Nx 9.1 .
97.Sh CAVEATS
98The
99.Nm
100TRNG's underlying source of randomness is not documented by Allwinner,
101so is not trusted as a reliable source of entropy.
102Initial tests using NIST's SP800-90B tools showed highly biased
103runs of output, suggesting any potential physical source is not
104subject to whitening.
105.Pp
106Cryptographic operations using
107.Nm
108are generally slower than using the CPU on supported devices, but provide
109an advantage in terms of hardware offloading if the CPU is busy.
110