modes/gcm128.c: coalesce calls to GHASH.
authorAndy Polyakov <appro@openssl.org>
Sun, 20 May 2018 10:02:39 +0000 (12:02 +0200)
committerAndy Polyakov <appro@openssl.org>
Sun, 3 Jun 2018 19:13:28 +0000 (21:13 +0200)
commitc1b2569d234c1247d2a7a3338ca4568bc0a489a5
tree15968c43ea2260cee4224251285ddf0017860938
parentc5307d9cc079f379ee0e2bc960abda73046cd4ec
modes/gcm128.c: coalesce calls to GHASH.

On contemporary platforms assembly GHASH processes multiple blocks
faster than one by one. For TLS payloads shorter than 16 bytes, e.g.
alerts, it's possible to reduce hashing operation to single call.
And for block lengths not divisible by 16 - fold two final calls to
one. Improvement is most noticeable with "reptoline", because call to
assembly GHASH is indirect.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6312)
crypto/modes/gcm128.c
crypto/modes/modes_lcl.h