tls: on x86, use xorbuf_aligned_AES_BLOCK_SIZE() even with non-aligned source

function                                             old     new   delta
aesgcm_GHASH                                         228     223      -5

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2018-11-25 12:01:44 +01:00
parent ab3c5e4c44
commit 23d0d8caf4

View File

@ -116,8 +116,10 @@ void FAST_FUNC aesgcm_GHASH(byte* h,
blocks = cSz / AES_BLOCK_SIZE;
partial = cSz % AES_BLOCK_SIZE;
while (blocks--) {
//xorbuf_aligned_AES_BLOCK_SIZE(x, c); - c is not guaranteed to be aligned
xorbuf(x, c, AES_BLOCK_SIZE);
if (BB_UNALIGNED_MEMACCESS_OK) // c is not guaranteed to be aligned
xorbuf_aligned_AES_BLOCK_SIZE(x, c);
else
xorbuf(x, c, AES_BLOCK_SIZE);
GMULT(x, h);
c += AES_BLOCK_SIZE;
}