Fix SipHash init order.
authorRichard Levitte <levitte@openssl.org>
Sun, 11 Nov 2018 11:23:26 +0000 (12:23 +0100)
committerRichard Levitte <levitte@openssl.org>
Mon, 12 Nov 2018 06:15:55 +0000 (07:15 +0100)
commit425036130dfb3cfbef5937772f7526ce60133264
tree17ee9c186aa40a33822e716498248a2be1b31ed8
parent59fbc8ef9a9c0700fd2b107fea390470ff17ada4
Fix SipHash init order.

Setting the SipHash hash size and setting its key is done with two
independent functions...  and yet, the internals depend on both.

Unfortunately, the function to change the size wasn't adapted for the
possibility that the key was set first, with a different hash size.

This changes the hash setting function to fix the internal values
(which is easy, fortunately) according to the hash size.

evpmac.txt value for digestsize:8 is also corrected.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/7613)
crypto/siphash/siphash.c
test/recipes/30-test_evp_data/evpmac.txt