AESNI(4)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… AESNI(4) πŸ’…

okay bestie, welcome to aesni(4), aka the manual page for the driver for the AES and SHA accelerator on x86 CPUs. yes that's the title AND the name, we're being efficient today ✨


🌸 NAME 🌸

aesni β€” the driver for the AES and SHA accelerator on x86 CPUs, no cap 🫢


✨ SYNOPSIS ✨

so if you want to compile this driver into the kernel (iconic move, very committed of you), you drop these lines into your kernel configuration file:

device crypto
device cryptodev
device aesni

alternatively, if you'd rather load the driver as a module at boot time (lowkey the easier route tbh), you put this line in loader.conf(5):

aesni_load="YES"

that's it. that's the whole vibe check πŸŽ€


πŸ”₯ DESCRIPTION πŸ”₯

okay so starting with Intel Westmere and AMD Bulldozer, some x86 processors implement a new set of instructions called AESNI. the set of six instructions accelerates the calculation of the key schedule for key lengths of 128, 192, and 256 of the Advanced Encryption Standard (AES) symmetric cipher, and it also provides a hardware implementation of the regular and the last encryption and decryption rounds. it's giving hardware go brrr πŸ’…

the processor capability is reported as AESNI in the Features2 line at boot. iykyk, go check your dmesg 🌈

then β€” starting with the Intel Goldmont and AMD Ryzen microarchitectures β€” some x86 processors implement a new set of SHA instructions. this set of seven instructions accelerates the calculation of SHA1 and SHA256 hashes. obsessed honestly πŸ¦‹

this processor capability is reported as SHA in the Structured Extended Features line at boot.

now the important bit, bestie, listen up πŸ‘‘: the aesni driver does not attach on systems that lack both CPU capabilities. but on systems that support only one of the AESNI or SHA extensions, the driver will attach and support that one function. equality, we love to see it 🫢

the aesni driver registers itself to accelerate AES and SHA operations for crypto(4). and besides the obvious speed thing, the advantage of using the aesni driver is that the AESNI operation is data-independent β€” which eliminates some attack vectors based on measuring cache use and timings that are typically present in table-driven implementations. so it's fast and it's secure, main character energy fr fr πŸ”₯


πŸ’– SEE ALSO πŸ’–

go read them, they're all slay in their own way ✨


πŸŽ€ HISTORY πŸŽ€

the aesni driver first appeared in FreeBSD 9.0. and the SHA support was added later, in FreeBSD 12.0. glow-up era 🌸


🧚 AUTHORS 🧚

the aesni driver was written by Konstantin Belousov <kib@FreeBSD.org> and Conrad Meyer <cem@FreeBSD.org>. the key schedule calculation code was adopted from the sample provided by Intel and used in the analogous OpenBSD driver. and the hash step intrinsics implementations were supplied by Intel. legends, all of them πŸ‘‘


ngl this whole thing is a flex: hardware crypto that doesn't leak your secrets through timing side channels. protect her at all costs 😭

that's the page bestie, hope it ate πŸ’œ β€” this one came from the Debian edition, dated July 29, 2020. bye babe, stay encrypted πŸ“

πŸ“¦ where this page comes from