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 | |
parent | ab3c5e4c44c73dafeb01439882b48e2259611e34 (diff) | |
download | busybox-w32-23d0d8caf42b6b55e531b2405d949c6606ed3e85.tar.gz busybox-w32-23d0d8caf42b6b55e531b2405d949c6606ed3e85.tar.bz2 busybox-w32-23d0d8caf42b6b55e531b2405d949c6606ed3e85.zip |
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>
-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, | |||
116 | blocks = cSz / AES_BLOCK_SIZE; | 116 | blocks = cSz / AES_BLOCK_SIZE; |
117 | partial = cSz % AES_BLOCK_SIZE; | 117 | partial = cSz % AES_BLOCK_SIZE; |
118 | while (blocks--) { | 118 | while (blocks--) { |
119 | //xorbuf_aligned_AES_BLOCK_SIZE(x, c); - c is not guaranteed to be aligned | 119 | if (BB_UNALIGNED_MEMACCESS_OK) // c is not guaranteed to be aligned |
120 | xorbuf(x, c, AES_BLOCK_SIZE); | 120 | xorbuf_aligned_AES_BLOCK_SIZE(x, c); |
121 | else | ||
122 | xorbuf(x, c, AES_BLOCK_SIZE); | ||
121 | GMULT(x, h); | 123 | GMULT(x, h); |
122 | c += AES_BLOCK_SIZE; | 124 | c += AES_BLOCK_SIZE; |
123 | } | 125 | } |