Fix tls_cbc_digest_record is slow using SHA-384 and short messages
authorarmfazh <armfazh@gmail.com>
Thu, 18 Oct 2018 22:26:58 +0000 (08:26 +1000)
committerPauli <paul.dale@oracle.com>
Thu, 18 Oct 2018 22:26:58 +0000 (08:26 +1000)
commitcb8164b05e3bad5586c2a109bbdbab1ad65a1a6f
treee991589a84fed3cf61db71115d2ff80780b3a65e
parentdc5831da59e9bfad61ba425d886a0b06ac160cd6
Fix tls_cbc_digest_record is slow using SHA-384 and short messages

The formula used for this is now

kVarianceBlocks = ((255 + 1 + md_size + md_block_size - 1) / md_block_size) + 1

Notice that md_block_size=64 for SHA256, which results on the
magic constant kVarianceBlocks = 6.
However, md_block_size=128 for SHA384 leading to kVarianceBlocks = 4.

CLA:trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/7342)
ssl/s3_cbc.c