X-Git-Url: https://bearssl.org/gitweb//home/git/?p=BearSSL;a=blobdiff_plain;f=src%2Fsymcipher%2Faes_x86ni_ctr.c;h=292d044e007ae8550a541f30365227feb3b43c06;hp=41c31b2634a50e0b0971e9916383235fcdd05b7d;hb=af9c79a0710a45361f9ae4313f8bb5bf738c3b7a;hpb=5b980fb6250788735f56d9640696864e82e35f59 diff --git a/src/symcipher/aes_x86ni_ctr.c b/src/symcipher/aes_x86ni_ctr.c index 41c31b2..292d044 100644 --- a/src/symcipher/aes_x86ni_ctr.c +++ b/src/symcipher/aes_x86ni_ctr.c @@ -22,24 +22,17 @@ * SOFTWARE. */ +#define BR_ENABLE_INTRINSICS 1 #include "inner.h" #if BR_AES_X86NI -#if BR_AES_X86NI_GCC -#if BR_AES_X86NI_GCC_OLD -#pragma GCC target("sse2,sse4.1,aes,pclmul") -#endif -#include -#include -#define bswap32 __builtin_bswap32 -#endif - -#if BR_AES_X86NI_MSC -#include -#include -#define bswap32 _byteswap_ulong -#endif +/* see bearssl_block.h */ +const br_block_ctr_class * +br_aes_x86ni_ctr_get_vtable(void) +{ + return br_aes_x86ni_supported() ? &br_aes_x86ni_ctr_vtable : NULL; +} /* see bearssl_block.h */ void @@ -50,6 +43,8 @@ br_aes_x86ni_ctr_init(br_aes_x86ni_ctr_keys *ctx, ctx->num_rounds = br_aes_x86ni_keysched_enc(ctx->skey.skni, key, len); } +BR_TARGETS_X86_UP + /* see bearssl_block.h */ BR_TARGET("sse2,sse4.1,aes") uint32_t @@ -190,6 +185,8 @@ br_aes_x86ni_ctr_run(const br_aes_x86ni_ctr_keys *ctx, return cc; } +BR_TARGETS_X86_DOWN + /* see bearssl_block.h */ const br_block_ctr_class br_aes_x86ni_ctr_vtable = { sizeof(br_aes_x86ni_ctr_keys), @@ -202,13 +199,6 @@ const br_block_ctr_class br_aes_x86ni_ctr_vtable = { &br_aes_x86ni_ctr_run }; -/* see bearssl_block.h */ -const br_block_ctr_class * -br_aes_x86ni_ctr_get_vtable(void) -{ - return br_aes_x86ni_supported() ? &br_aes_x86ni_ctr_vtable : NULL; -} - #else /* see bearssl_block.h */