projects
/
BearSSL
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added stand-alone RSA/PSS implementation.
[BearSSL]
/
src
/
symcipher
/
aes_x86ni_cbcdec.c
diff --git
a/src/symcipher/aes_x86ni_cbcdec.c
b/src/symcipher/aes_x86ni_cbcdec.c
index
6f75348
..
862b1b5
100644
(file)
--- a/
src/symcipher/aes_x86ni_cbcdec.c
+++ b/
src/symcipher/aes_x86ni_cbcdec.c
@@
-22,17
+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 <wmmintrin.h>
-#endif
-
-#if BR_AES_X86NI_MSC
-#include <intrin.h>
-#endif
+/* see bearssl_block.h */
+const br_block_cbcdec_class *
+br_aes_x86ni_cbcdec_get_vtable(void)
+{
+ return br_aes_x86ni_supported() ? &br_aes_x86ni_cbcdec_vtable : NULL;
+}
/* see bearssl_block.h */
void
/* see bearssl_block.h */
void
@@
-43,6
+43,8
@@
br_aes_x86ni_cbcdec_init(br_aes_x86ni_cbcdec_keys *ctx,
ctx->num_rounds = br_aes_x86ni_keysched_dec(ctx->skey.skni, key, len);
}
ctx->num_rounds = br_aes_x86ni_keysched_dec(ctx->skey.skni, key, len);
}
+BR_TARGETS_X86_UP
+
/* see bearssl_block.h */
BR_TARGET("sse2,aes")
void
/* see bearssl_block.h */
BR_TARGET("sse2,aes")
void
@@
-75,14
+77,16
@@
br_aes_x86ni_cbcdec_run(const br_aes_x86ni_cbcdec_keys *ctx,
if (len >= 48) {
x2 = _mm_loadu_si128(
(void *)(buf + 32));
if (len >= 48) {
x2 = _mm_loadu_si128(
(void *)(buf + 32));
+ x3 = x2;
} else {
x2 = x0;
} else {
x2 = x0;
+ x3 = x1;
}
} else {
x1 = x0;
x2 = x0;
}
} else {
x1 = x0;
x2 = x0;
+ x3 = x0;
}
}
- x3 = x0;
}
e0 = x0;
e1 = x1;
}
e0 = x0;
e1 = x1;
@@
-194,6
+198,8
@@
br_aes_x86ni_cbcdec_run(const br_aes_x86ni_cbcdec_keys *ctx,
_mm_storeu_si128(iv, ivx);
}
_mm_storeu_si128(iv, ivx);
}
+BR_TARGETS_X86_DOWN
+
/* see bearssl_block.h */
const br_block_cbcdec_class br_aes_x86ni_cbcdec_vtable = {
sizeof(br_aes_x86ni_cbcdec_keys),
/* see bearssl_block.h */
const br_block_cbcdec_class br_aes_x86ni_cbcdec_vtable = {
sizeof(br_aes_x86ni_cbcdec_keys),
@@
-205,13
+211,6
@@
const br_block_cbcdec_class br_aes_x86ni_cbcdec_vtable = {
&br_aes_x86ni_cbcdec_run
};
&br_aes_x86ni_cbcdec_run
};
-/* see bearssl_block.h */
-const br_block_cbcdec_class *
-br_aes_x86ni_cbcdec_get_vtable(void)
-{
- return br_aes_x86ni_supported() ? &br_aes_x86ni_cbcdec_vtable : NULL;
-}
-
#else
/* see bearssl_block.h */
#else
/* see bearssl_block.h */