]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/aesni.4
sys/{x86,amd64}: remove one of doubled ;s
[FreeBSD/FreeBSD.git] / share / man / man4 / aesni.4
1 .\" Copyright (c) 2010 Konstantin Belousov <kib@FreeBSD.org>
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd September 26, 2017
28 .Dt AESNI 4
29 .Os
30 .Sh NAME
31 .Nm aesni
32 .Nd "driver for the AES and SHA accelerator on x86 CPUs"
33 .Sh SYNOPSIS
34 To compile this driver into the kernel,
35 place the following lines in your
36 kernel configuration file:
37 .Bd -ragged -offset indent
38 .Cd "device crypto"
39 .Cd "device cryptodev"
40 .Cd "device aesni"
41 .Ed
42 .Pp
43 Alternatively, to load the driver as a
44 module at boot time, place the following line in
45 .Xr loader.conf 5 :
46 .Bd -literal -offset indent
47 aesni_load="YES"
48 .Ed
49 .Sh DESCRIPTION
50 Starting with Intel Westmere and AMD Bulldozer, some x86 processors implement a
51 new set of instructions called AESNI.
52 The set of six instructions accelerates the calculation of the key
53 schedule for key lengths of 128, 192, and 256 of the Advanced
54 Encryption Standard (AES) symmetric cipher, and provides a hardware
55 implementation of the regular and the last encryption and decryption
56 rounds.
57 .Pp
58 The processor capability is reported as AESNI in the Features2 line at boot.
59 .Pp
60 Starting with the Intel Goldmont and AMD Ryzen microarchitectures, some x86
61 processors implement a new set of SHA instructions.
62 The set of seven instructions accelerates the calculation of SHA1 and SHA256
63 hashes.
64 .Pp
65 The processor capability is reported as SHA in the Structured Extended Features
66 line at boot.
67 .Pp
68 The
69 .Nm
70 driver does not attach on systems that lack both CPU capabilities.
71 On systems that support only one of AESNI or SHA extensions, the driver will
72 attach and support that one function.
73 .Pp
74 The
75 .Nm
76 driver registers itself to accelerate AES and SHA operations for
77 .Xr crypto 4 .
78 Besides speed, the advantage of using the
79 .Nm
80 driver is that the AESNI operation
81 is data-independent, thus eliminating some attack vectors based on
82 measuring cache use and timings typically present in table-driven
83 implementations.
84 .Sh SEE ALSO
85 .Xr crypt 3 ,
86 .Xr crypto 4 ,
87 .Xr intro 4 ,
88 .Xr ipsec 4 ,
89 .Xr padlock 4 ,
90 .Xr random 4 ,
91 .Xr crypto 9
92 .Sh HISTORY
93 The
94 .Nm
95 driver first appeared in
96 .Fx 9.0 .
97 SHA support was added in
98 .Fx 12.0 .
99 .Sh AUTHORS
100 .An -nosplit
101 The
102 .Nm
103 driver was written by
104 .An Konstantin Belousov Aq Mt kib@FreeBSD.org
105 and
106 .An Conrad Meyer Aq Mt cem@FreeBSD.org .
107 The key schedule calculation code was adopted from the sample provided
108 by Intel and used in the analogous
109 .Ox
110 driver.
111 The hash step intrinsics implementations were supplied by Intel.