Use 17 bytes of space-left for 128-byte block hash (#824)
Use 17 bytes of space-left for 128-byte block hash (#824)

* Brute-force comparison test for s2n_constant_time_equals

OpenSSL recently found an interesting security issue: crypto_memcmp
was comparing only the least significant bit on HPUX due to an
incorrect assembly implementation.

Our existing positive and negative test cases would not find an issue
like this (especially in the MSB).

This commit adds a test that a full brute-force comparison between
all possible 256 * 256 byte values.

* Remove trailing whitespace

* Use 17 bytes of space-left for 128-byte block hash

Performing a constant number of compression rounds is a mitigation
against Lucky13 timing attacks. s2n was not performing a constant
number of compression rounds for SHA284 based ciphersuites, as
the block size is larger 17 bytes.

The impact of this issue is categorized as "NONE" as s2n does not
use any SHA384 ciphersuites and one is included for compatibility
testing in our test suites.

This commit fixes the issue. The issue was discovered twice
independently. Our own Daniel Schwartz-Narbonne discovered
it in the course of developing SideTrail, a tool for automated
formal anaylsis of Side Channels in C code. See:

https://github.com/awslabs/s2n/tree/master/tests/sidewinder

Eyal Ronen, Kenneth G. Paterson, and Adi Shamir also discovered
it in the course of their research into further Lucky13 issues
in several implementations of TLS/SSL. See:

https://eprint.iacr.org/2018/747.pdf

* Use a ternary operator for brevity

Simplify the hash block size selection

raycoll/s2n,raycoll/s2n,bpdavidson/s2n,alexeblee/s2n,PKRoma/s2n,raycoll/s2n,PKRoma/s2n,colmmacc/s2n,colmmacc/s2n,awslabs/s2n,gibson-compsci/s2n,raycoll/s2n,awslabs/s2n,wcs1only/s2n,wcs1only/s2n,awslabs/s2n,wcs1only/s2n,wcs1only/s2n,alexeblee/s2n,awslabs/s2n,PKRoma/s2n,gibson-compsci/s2n,raycoll/s2n,colmmacc/s2n,colmmacc/s2n,alexeblee/s2n,awslabs/s2n,alexeblee/s2n,PKRoma/s2n,gibson-compsci/s2n,wcs1only/s2n,PKRoma/s2n,bpdavidson/s2n,awslabs/s2n,colmmacc/s2n,gibson-compsci/s2n,PKRoma/s2n,bpdavidson/s2n,bpdavidson/s2n,raycoll/s2n,wcs1only/s2n,alexeblee/s2n,PKRoma/s2n,gibson-compsci/s2n,wcs1only/s2n,colmmacc/s2n,bpdavidson/s2n,wcs1only/s2n,alexeblee/s2n,PKRoma/s2n,bpdavidson/s2n,gibson-compsci/s2n