Skip to content

Instantly share code, notes, and snippets.

@acapola
acapola / aes-ni.c
Created Aug 31, 2015
AES128 how-to using GCC and Intel AES-NI
View aes-ni.c
#include <stdint.h> //for int8_t
#include <string.h> //for memcmp
#include <wmmintrin.h> //for intrinsics for AES-NI
//compile using gcc and following arguments: -g;-O0;-Wall;-msse2;-msse;-march=native;-maes
//internal stuff
//macros
#define DO_ENC_BLOCK(m,k) \
do{\