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.\" 27edb78df0SKonstantin Belousov.Dd September 6, 2010 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" 39edb78df0SKonstantin Belousov.Cd "device aesni" 40edb78df0SKonstantin Belousov.Ed 41edb78df0SKonstantin Belousov.Pp 42edb78df0SKonstantin BelousovAlternatively, to load the driver as a 43edb78df0SKonstantin Belousovmodule at boot time, place the following line in 44edb78df0SKonstantin Belousov.Xr loader.conf 5 : 45edb78df0SKonstantin Belousov.Bd -literal -offset indent 46edb78df0SKonstantin Belousovaesni_load="YES" 47edb78df0SKonstantin Belousov.Ed 48edb78df0SKonstantin Belousov.Sh DESCRIPTION 49edb78df0SKonstantin BelousovStarting with some models of Core i5/i7, Intel processors implement 50*f5447a30SKonstantin Belousova new set of instructions called AESNI. 51edb78df0SKonstantin BelousovThe set of six instructions accelerates the calculation of the key 52edb78df0SKonstantin Belousovschedule for key lengths of 128, 192, and 256 of the Advanced 53*f5447a30SKonstantin BelousovEncryption Standard (AES) symmetric cipher, and provides hardware 54edb78df0SKonstantin Belousovimplementation of the regular and the last encryption and decryption 55edb78df0SKonstantin Belousovrounds. 56edb78df0SKonstantin Belousov.Pp 57*f5447a30SKonstantin BelousovThe processor capability is reported as AESNI in the Features2 line at boot. 58*f5447a30SKonstantin BelousovDriver does not attach on the system that lacks the required CPU capability. 59edb78df0SKonstantin Belousov.Pp 60edb78df0SKonstantin BelousovThe 61edb78df0SKonstantin Belousov.Nm 62edb78df0SKonstantin Belousovdriver registers itself to accelerate AES operations for 63edb78df0SKonstantin Belousov.Xr crypto 4 . 64*f5447a30SKonstantin BelousovBesides speed, the advantage of using the driver is that the AESNI operation 65*f5447a30SKonstantin Belousovis data-independent, thus eliminating some attack vectors based on 66*f5447a30SKonstantin Belousovmeasuring cache use and timings typically present in the table-driven 67edb78df0SKonstantin Belousovimplementations. 68edb78df0SKonstantin Belousov.Sh SEE ALSO 69edb78df0SKonstantin Belousov.Xr crypt 3 , 70edb78df0SKonstantin Belousov.Xr crypto 4 , 71edb78df0SKonstantin Belousov.Xr intro 4 , 72edb78df0SKonstantin Belousov.Xr ipsec 4 , 73edb78df0SKonstantin Belousov.Xr padlock 4 , 74edb78df0SKonstantin Belousov.Xr random 4 , 75edb78df0SKonstantin Belousov.Xr crypto 9 76edb78df0SKonstantin Belousov.Sh HISTORY 77edb78df0SKonstantin BelousovThe 78edb78df0SKonstantin Belousov.Nm 79edb78df0SKonstantin Belousovdriver first appeared in 80edb78df0SKonstantin Belousov.Fx 9.0 . 81edb78df0SKonstantin Belousov.Sh AUTHORS 82edb78df0SKonstantin Belousov.An -nosplit 83edb78df0SKonstantin BelousovThe 84edb78df0SKonstantin Belousov.Nm 85edb78df0SKonstantin Belousovdriver was written by 86edb78df0SKonstantin Belousov.An Konstantin Belousov Aq kib@FreeBSD.org . 87edb78df0SKonstantin BelousovThe key schedule calculation code was adopted from the sample provided 88edb78df0SKonstantin Belousovby Intel and used in the analogous 89edb78df0SKonstantin Belousov.Ox 90edb78df0SKonstantin Belousovdriver. 91