diff options
author | Andy Polyakov <appro@openssl.org> | 2013-10-12 22:10:28 +0200 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2013-10-12 22:10:28 +0200 |
commit | b4f0abd246340b90bb3fa2646814729f0e9d049e (patch) | |
tree | 8cfaef856b0e1371748a91da86ed72147da186e7 /crypto/evp/e_aes_cbc_hmac_sha1.c | |
parent | 7e1e3334f6d419a09da5f9f99bf448f18ff74867 (diff) |
evp/e_aes_cbc_hmac_sha*.c: limit multi-block fragmentation to 1KB.
Excessive fragmentation put additional burden (of addtional MAC
calculations) on the other size and limiting fragments it to 1KB
limits the overhead to ~6%.
Diffstat (limited to 'crypto/evp/e_aes_cbc_hmac_sha1.c')
-rw-r--r-- | crypto/evp/e_aes_cbc_hmac_sha1.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/evp/e_aes_cbc_hmac_sha1.c b/crypto/evp/e_aes_cbc_hmac_sha1.c index 15e96386b1..98ee2bba22 100644 --- a/crypto/evp/e_aes_cbc_hmac_sha1.c +++ b/crypto/evp/e_aes_cbc_hmac_sha1.c @@ -719,7 +719,8 @@ static int aesni_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void if (inp_len<4096) return 0; /* too short */ - if (OPENSSL_ia32cap_P[2]&(1<<5)) n4x=2; /* AVX2 */ + if (inp_len>=8192 && OPENSSL_ia32cap_P[2]&(1<<5)) + n4x=2; /* AVX2 */ key->md = key->head; SHA1_Update(&key->md,param->inp,13); |