1edb78df0SKonstantin Belousov.\" Copyright (c) 2010 Konstantin Belousov <kib@FreeBSD.org> 2edb78df0SKonstantin Belousov.\" All rights reserved. 3edb78df0SKonstantin Belousov.\" 4edb78df0SKonstantin Belousov.\" Redistribution and use in source and binary forms, with or without 5edb78df0SKonstantin Belousov.\" modification, are permitted provided that the following conditions 6edb78df0SKonstantin Belousov.\" are met: 7edb78df0SKonstantin Belousov.\" 1. Redistributions of source code must retain the above copyright 8edb78df0SKonstantin Belousov.\" notice, this list of conditions and the following disclaimer. 9edb78df0SKonstantin Belousov.\" 2. Redistributions in binary form must reproduce the above copyright 10edb78df0SKonstantin Belousov.\" notice, this list of conditions and the following disclaimer in the 11edb78df0SKonstantin Belousov.\" documentation and/or other materials provided with the distribution. 12edb78df0SKonstantin Belousov.\" 13edb78df0SKonstantin Belousov.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14edb78df0SKonstantin Belousov.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15edb78df0SKonstantin Belousov.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16edb78df0SKonstantin Belousov.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17edb78df0SKonstantin Belousov.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18edb78df0SKonstantin Belousov.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19edb78df0SKonstantin Belousov.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20edb78df0SKonstantin Belousov.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21edb78df0SKonstantin Belousov.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22edb78df0SKonstantin Belousov.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23edb78df0SKonstantin Belousov.\" SUCH DAMAGE. 24edb78df0SKonstantin Belousov.\" 25edb78df0SKonstantin Belousov.\" $FreeBSD$ 26edb78df0SKonstantin Belousov.\" 27*695be8b9SKevin Lo.Dd December 14, 2015 28edb78df0SKonstantin Belousov.Dt AESNI 4 29edb78df0SKonstantin Belousov.Os 30edb78df0SKonstantin Belousov.Sh NAME 31edb78df0SKonstantin Belousov.Nm aesni 32edb78df0SKonstantin Belousov.Nd "driver for the AES accelerator on Intel CPUs" 33edb78df0SKonstantin Belousov.Sh SYNOPSIS 34edb78df0SKonstantin BelousovTo compile this driver into the kernel, 35edb78df0SKonstantin Belousovplace the following lines in your 36edb78df0SKonstantin Belousovkernel configuration file: 37edb78df0SKonstantin Belousov.Bd -ragged -offset indent 38edb78df0SKonstantin Belousov.Cd "device crypto" 39*695be8b9SKevin Lo.Cd "device cryptodev" 40edb78df0SKonstantin Belousov.Cd "device aesni" 41edb78df0SKonstantin Belousov.Ed 42edb78df0SKonstantin Belousov.Pp 43edb78df0SKonstantin BelousovAlternatively, to load the driver as a 44edb78df0SKonstantin Belousovmodule at boot time, place the following line in 45edb78df0SKonstantin Belousov.Xr loader.conf 5 : 46edb78df0SKonstantin Belousov.Bd -literal -offset indent 47edb78df0SKonstantin Belousovaesni_load="YES" 48edb78df0SKonstantin Belousov.Ed 49edb78df0SKonstantin Belousov.Sh DESCRIPTION 50edb78df0SKonstantin BelousovStarting with some models of Core i5/i7, Intel processors implement 51f5447a30SKonstantin Belousova new set of instructions called AESNI. 52edb78df0SKonstantin BelousovThe set of six instructions accelerates the calculation of the key 53edb78df0SKonstantin Belousovschedule for key lengths of 128, 192, and 256 of the Advanced 546728a0dfSChristian BruefferEncryption Standard (AES) symmetric cipher, and provides a hardware 55edb78df0SKonstantin Belousovimplementation of the regular and the last encryption and decryption 56edb78df0SKonstantin Belousovrounds. 57edb78df0SKonstantin Belousov.Pp 58f5447a30SKonstantin BelousovThe processor capability is reported as AESNI in the Features2 line at boot. 596728a0dfSChristian BruefferThe 606728a0dfSChristian Brueffer.Nm 616728a0dfSChristian Bruefferdriver does not attach on systems that lack the required CPU capability. 62edb78df0SKonstantin Belousov.Pp 63edb78df0SKonstantin BelousovThe 64edb78df0SKonstantin Belousov.Nm 65edb78df0SKonstantin Belousovdriver registers itself to accelerate AES operations for 66edb78df0SKonstantin Belousov.Xr crypto 4 . 676728a0dfSChristian BruefferBesides speed, the advantage of using the 686728a0dfSChristian Brueffer.Nm 696728a0dfSChristian Bruefferdriver is that the AESNI operation 70f5447a30SKonstantin Belousovis data-independent, thus eliminating some attack vectors based on 716728a0dfSChristian Brueffermeasuring cache use and timings typically present in table-driven 72edb78df0SKonstantin Belousovimplementations. 73edb78df0SKonstantin Belousov.Sh SEE ALSO 74edb78df0SKonstantin Belousov.Xr crypt 3 , 75edb78df0SKonstantin Belousov.Xr crypto 4 , 76edb78df0SKonstantin Belousov.Xr intro 4 , 77edb78df0SKonstantin Belousov.Xr ipsec 4 , 78edb78df0SKonstantin Belousov.Xr padlock 4 , 79edb78df0SKonstantin Belousov.Xr random 4 , 80edb78df0SKonstantin Belousov.Xr crypto 9 81edb78df0SKonstantin Belousov.Sh HISTORY 82edb78df0SKonstantin BelousovThe 83edb78df0SKonstantin Belousov.Nm 84edb78df0SKonstantin Belousovdriver first appeared in 85edb78df0SKonstantin Belousov.Fx 9.0 . 86edb78df0SKonstantin Belousov.Sh AUTHORS 87edb78df0SKonstantin Belousov.An -nosplit 88edb78df0SKonstantin BelousovThe 89edb78df0SKonstantin Belousov.Nm 90edb78df0SKonstantin Belousovdriver was written by 916c899950SBaptiste Daroussin.An Konstantin Belousov Aq Mt kib@FreeBSD.org . 92edb78df0SKonstantin BelousovThe key schedule calculation code was adopted from the sample provided 93edb78df0SKonstantin Belousovby Intel and used in the analogous 94edb78df0SKonstantin Belousov.Ox 95edb78df0SKonstantin Belousovdriver. 96