/s-aes

Safe aes implementation using Intel's AES-NI instruction set extensions

Primary LanguageC++GNU General Public License v3.0GPL-3.0

S-AES

AES-128 bit implementation using Intel's AES-NI instruction set extensions. Use of AES-NI eliminates the need for AES lookup tables(S-box and Inverse S-box), which have been a source of cache-related timing side-channel vulnerabilities.

Prerequisites

In order to build this on your machine, you must have

  1. A C++17 compatible compiler
  2. A modern x86 processor supporting AES-NI

Build

Use premake to build this project. To build, simply

premake5 <target>

where target is gmake for unix makefiles or vs2019 for visual studio 2019 solution files. For more information about premake, checkout the official documentation.

Usage

constexpr std::size_t ROUNDS = 4; //only supports 4 and 10 rounds

aes128_encrypt<ROUNDS>(plainText, cipherText, sizeof plainText, key_schedule); //encrypting

aes128_decrypt<ROUNDS>(cipherText, decryptedText, sizeof plainText, key_schedule); //decrypting

Preview

You can find the compiler explorer preview here

License

GPL3