From 1a3849032ebf2e7d17b7ee421af28b17f4de1407 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 26 May 2016 09:26:09 +0100 Subject: [PATCH] symm/rijndael-x86ish-aesni.S: Have `endswap_block' copy NKW to ECX. Eliminate a tiny bit of code duplication. It's not like anyone else uses that subroutine. --- symm/rijndael-x86ish-aesni.S | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/symm/rijndael-x86ish-aesni.S b/symm/rijndael-x86ish-aesni.S index 520a72e4..f9386541 100644 --- a/symm/rijndael-x86ish-aesni.S +++ b/symm/rijndael-x86ish-aesni.S @@ -374,12 +374,10 @@ FUNC(rijndael_setup_x86ish_aesni) #endif // End-swap the encryption keys. - mov ecx, NKW lea SI, [CTX + w] call endswap_block // And the decryption keys. - mov ecx, NKW lea SI, [CTX + wi] call endswap_block @@ -398,14 +396,15 @@ FUNC(rijndael_setup_x86ish_aesni) .align 16 endswap_block: - // End-swap ECX words starting at SI. The end-swapping table is + // End-swap NKW words starting at SI. The end-swapping table is // already loaded into XMM5; and it's OK to work in 16-byte chunks. - movdqu xmm1, [SI] + mov ecx, NKW +0: movdqu xmm1, [SI] pshufb xmm1, xmm5 movdqu [SI], xmm1 add SI, 16 sub ecx, 4 - ja endswap_block + ja 0b ret #undef CTX -- 2.11.0