mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
ChiperBlock XOR
This commit is contained in:
parent
61147def94
commit
9372b33c2c
16
aes.h
16
aes.h
|
@ -13,6 +13,22 @@ namespace crypto
|
||||||
{
|
{
|
||||||
uint8_t buf[16];
|
uint8_t buf[16];
|
||||||
uint64_t ll[2];
|
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__
|
#ifdef __x86_64__
|
||||||
|
|
Loading…
Reference in a new issue