FreeBSD/sys/crypto/aesni/aesencdec.h
/* rounds is passed in as rounds - 1 */
rounds is passed in as rounds - 1
rounds is passed in as rounds - 1
static inline __m128i
aesni_enc(int rounds, const __m128i *keysched, const __m128i from)
{
	__m128i tmp;
	int i;
	tmp = from ^ keysched[0];
	for (i = 1; i < rounds; i += 2) {
		tmp = _mm_aesenc_si128(tmp, keysched[i]);
		tmp = _mm_aesenc_si128(tmp, keysched[i + 1]);
	}
	tmp = _mm_aesenc_si128(tmp, keysched[rounds]);
	return _mm_aesenclast_si128(tmp, keysched[rounds + 1]);
}
static inline __m128i aesni_enc ( int rounds , const __m128i * keysched , const __m128i from ) { __m128i tmp ; int i ; tmp = from ^ keysched [ 0 ] ; for ( i = 1 ; i < rounds ; i += 2 ) { tmp = _mm_aesenc_si128 ( tmp , keysched [ i ] ) ; tmp = _mm_aesenc_si128 ( tmp , keysched [ i + 1 ] ) ; } tmp = _mm_aesenc_si128 ( tmp , keysched [ rounds ] ) ; return _mm_aesenclast_si128 ( tmp , keysched [ rounds + 1 ] ) ; }
rounds is passed in as rounds - 1
rounds is passed in as rounds - 1