mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-29 04:07:49 +02:00
use AEN-NI for garlic encryption
This commit is contained in:
parent
cc302847a8
commit
3eb4cc9eed
3 changed files with 25 additions and 30 deletions
11
aes.h
11
aes.h
|
@ -16,19 +16,8 @@ namespace crypto
|
|||
|
||||
void operator^=(const ChipherBlock& other) // XOR
|
||||
{
|
||||
#ifdef __x86_64__
|
||||
__asm__
|
||||
(
|
||||
"movups (%[b1]), %%xmm0 \n"
|
||||
"movups (%[b2]), %%xmm1 \n" // b2 might not be 16-bytes aligned
|
||||
"pxor %%xmm1, %%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
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue