diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-11-25 12:01:44 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-11-25 12:02:45 +0100 |
commit | 23d0d8caf42b6b55e531b2405d949c6606ed3e85 (patch) | |
tree | e32bb50671b092f80b6a154078497d4ef57ece4a /networking | |
parent | ab3c5e4c44c73dafeb01439882b48e2259611e34 (diff) |
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>
Diffstat (limited to 'networking')
-rw-r--r-- | networking/tls_aesgcm.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; } |