This commit is contained in:
Adam Ierymenko 2018-01-09 08:35:02 -08:00
parent 6fbd15f8b2
commit 01b4cb64ee
2 changed files with 6 additions and 14 deletions

View File

@ -47,7 +47,7 @@ static inline void ZT_FAST_MEMCPY(void *a,const void *b,unsigned long k)
{
char *aa = reinterpret_cast<char *>(a);
const char *bb = reinterpret_cast<const char *>(b);
while (likely(k >= 128)) {
while (k >= 64) {
__m128 t1 = _mm_loadu_ps(reinterpret_cast<const float *>(bb));
__m128 t2 = _mm_loadu_ps(reinterpret_cast<const float *>(bb + 16));
__m128 t3 = _mm_loadu_ps(reinterpret_cast<const float *>(bb + 32));
@ -56,19 +56,11 @@ static inline void ZT_FAST_MEMCPY(void *a,const void *b,unsigned long k)
_mm_storeu_ps(reinterpret_cast<float *>(aa + 16),t2);
_mm_storeu_ps(reinterpret_cast<float *>(aa + 32),t3);
_mm_storeu_ps(reinterpret_cast<float *>(aa + 48),t4);
t1 = _mm_loadu_ps(reinterpret_cast<const float *>(bb + 64));
t2 = _mm_loadu_ps(reinterpret_cast<const float *>(bb + 80));
t3 = _mm_loadu_ps(reinterpret_cast<const float *>(bb + 96));
t4 = _mm_loadu_ps(reinterpret_cast<const float *>(bb + 112));
_mm_storeu_ps(reinterpret_cast<float *>(aa + 64),t1);
_mm_storeu_ps(reinterpret_cast<float *>(aa + 80),t2);
_mm_storeu_ps(reinterpret_cast<float *>(aa + 96),t3);
_mm_storeu_ps(reinterpret_cast<float *>(aa + 112),t4);
bb += 128;
aa += 128;
k -= 128;
bb += 64;
aa += 64;
k -= 64;
}
while (likely(k >= 16)) {
while (k >= 16) {
__m128 t1 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(bb));
_mm_storeu_si128(reinterpret_cast<__m128i *>(aa),t1);
bb += 16;

View File

@ -621,7 +621,7 @@ static int testPacket()
return -1;
}
a.armor(salsaKey,true,0);
a.armor(salsaKey,true);
if (!a.dearmor(salsaKey)) {
std::cout << "FAIL (encrypt-decrypt/verify)" << std::endl;
return -1;