diff options
Diffstat (limited to 'include/aesni')
-rw-r--r-- | include/aesni/data.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/aesni/data.h b/include/aesni/data.h index dec9367..4ed9f9f 100644 --- a/include/aesni/data.h +++ b/include/aesni/data.h @@ -45,6 +45,18 @@ typedef struct } Aes256KeySchedule; +static __inline AesBlock128 __fastcall aes128_le2be(AesBlock128 block) +{ + __declspec(align(16)) char xs[16]; + _mm_store_si128((__m128i*) xs, block); + return _mm_set_epi8(xs[0], xs[1], xs[2], xs[3], xs[4], xs[5], xs[6], xs[7], xs[8], xs[9], xs[10], xs[11], xs[12], xs[13], xs[14], xs[15]); +} + +static __inline AesBlock128 __fastcall aes128_be2le(AesBlock128 block) +{ + return aes128_le2be(block); +} + AesBlock128 make_aes_block128(int hi3, int hi2, int lo1, int lo0); AesBlock192 make_aes_block192(int hi5, int hi4, int lo3, int lo2, int lo1, int lo0); AesBlock256 make_aes_block256(int hi7, int hi6, int hi5, int hi4, int lo3, int lo2, int lo1, int lo0); |