projects
/
BearSSL
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added seeder API. Also overhauled compile-time detection of features.
[BearSSL]
/
src
/
symcipher
/
aes_x86ni_ctr.c
diff --git
a/src/symcipher/aes_x86ni_ctr.c
b/src/symcipher/aes_x86ni_ctr.c
index
a476843
..
292d044
100644
(file)
--- a/
src/symcipher/aes_x86ni_ctr.c
+++ b/
src/symcipher/aes_x86ni_ctr.c
@@
-22,21
+22,17
@@
* SOFTWARE.
*/
* SOFTWARE.
*/
+#define BR_ENABLE_INTRINSICS 1
#include "inner.h"
#if BR_AES_X86NI
#include "inner.h"
#if BR_AES_X86NI
-#if BR_AES_X86NI_GCC
-#include <smmintrin.h>
-#include <wmmintrin.h>
-#define bswap32 __builtin_bswap32
-#endif
-
-#if BR_AES_X86NI_MSC
-#include <stdlib.h>
-#include <intrin.h>
-#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
/* see bearssl_block.h */
void
@@
-47,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);
}
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
/* see bearssl_block.h */
BR_TARGET("sse2,sse4.1,aes")
uint32_t
@@
-187,6
+185,8
@@
br_aes_x86ni_ctr_run(const br_aes_x86ni_ctr_keys *ctx,
return cc;
}
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),
/* see bearssl_block.h */
const br_block_ctr_class br_aes_x86ni_ctr_vtable = {
sizeof(br_aes_x86ni_ctr_keys),
@@
-199,13
+199,6
@@
const br_block_ctr_class br_aes_x86ni_ctr_vtable = {
&br_aes_x86ni_ctr_run
};
&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 */
#else
/* see bearssl_block.h */