ChiperBlock XOR

This commit is contained in:
orignal 2014-05-09 11:44:39 -04:00
parent 61147def94
commit 9372b33c2c

16
aes.h
View File

@ -13,6 +13,22 @@ namespace crypto
{
uint8_t buf[16];
uint64_t ll[2];
void operator^(const ChipherBlock& other) // XOR
{
#ifdef __x86_64__
__asm__
(
"movups (%[b1]), %%xmm0 \n"
"pxor (%[b2]), %%xmm0 \n"
"movups %%xmm0, (%[b1]) \n"
: : [b1]"r"(buf), [b2]"r"(other.buf): "memory", "%xmm0"
);
#else
ll[0] ^= other.ll[0];
ll[1] ^= other.ll[1];
#endif
}
};
#ifdef __x86_64__