From: Denys Vlasenko Date: Sun, 25 Nov 2018 11:01:44 +0000 (+0100) Subject: tls: on x86, use xorbuf_aligned_AES_BLOCK_SIZE() even with non-aligned source X-Git-Tag: 1_30_0~373 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=23d0d8caf42b6b55e531b2405d949c6606ed3e85;p=oweals%2Fbusybox.git 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 --- diff --git a/networking/tls_aesgcm.c b/networking/tls_aesgcm.c index fd72540c4..32ca40260 100644 --- a/networking/tls_aesgcm.c +++ b/networking/tls_aesgcm.c @@ -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; }