Commit 3f5616d7 authored by Todd Short's avatar Todd Short Committed by Rich Salz
Browse files

Add support for parameterized SipHash



The core SipHash supports either 8 or 16-byte output and a configurable
number of rounds.
The default behavior, as added to EVP, is to use 16-byte output and
2,4 rounds, which matches the behavior of most implementations.
There is an EVP_PKEY_CTRL that can control the output size.

Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2216)
parent 122fa088
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4,6 +4,9 @@
 Changes between 1.1.0a and 1.1.1 [xx XXX xxxx]
  *) Add support for SipHash
     [Todd Short]
  *) OpenSSL now fails if it receives an unrecognised record type in TLS1.0
     or TLS1.1. Previously this only happened in SSLv3 and TLS1.2. This is to
     prevent issues where no progress is being made and the peer continually
+2 −1
Original line number Diff line number Diff line
@@ -313,7 +313,7 @@ $config{dirs} = [ "crypto", "ssl", "engines", "apps", "test", "util", "tools", "
# crypto/ subdirectories to build
$config{sdirs} = [
    "objects",
    "md2", "md4", "md5", "sha", "mdc2", "hmac", "ripemd", "whrlpool", "poly1305", "blake2",
    "md2", "md4", "md5", "sha", "mdc2", "hmac", "ripemd", "whrlpool", "poly1305", "blake2", "siphash",
    "des", "aes", "rc2", "rc4", "rc5", "idea", "bf", "cast", "camellia", "seed", "chacha", "modes",
    "bn", "ec", "rsa", "dsa", "dh", "dso", "engine",
    "buffer", "bio", "stack", "lhash", "rand", "err",
@@ -397,6 +397,7 @@ my @disablables = (
    "sctp",
    "seed",
    "shared",
    "siphash",
    "sock",
    "srp",
    "srtp",
+3 −2
Original line number Diff line number Diff line
@@ -494,8 +494,9 @@
                   Build without support for the specified algorithm, where
                   <alg> is one of: bf, blake2, camellia, cast, chacha, cmac,
                   des, dh, dsa, ecdh, ecdsa, idea, md4, mdc2, ocb, poly1305,
                   rc2, rc4, rmd160, scrypt, seed or whirlpool. The "ripemd"
                   algorithm is deprecated and if used is synonymous with rmd160.
                   rc2, rc4, rmd160, scrypt, seed, siphash or whirlpool. The
                   "ripemd" algorithm is deprecated and if used is synonymous
                   with rmd160.

  -Dxxx, -lxxx, -Lxxx, -fxxx, -mXXX, -Kxxx
                   These system specific options will be passed through to the
+4 −1
Original line number Diff line number Diff line
/*
 * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
 * Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the OpenSSL license (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
@@ -46,5 +46,8 @@ static const EVP_PKEY_ASN1_METHOD *standard_methods[] = {
#ifndef OPENSSL_NO_POLY1305
    &poly1305_asn1_meth,
#endif
#ifndef OPENSSL_NO_SIPHASH
    &siphash_asn1_meth,
#endif
};
+2 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ static ERR_STRING_DATA EVP_str_functs[] = {
    {ERR_FUNC(EVP_F_EVP_PKEY_GET0_HMAC), "EVP_PKEY_get0_hmac"},
    {ERR_FUNC(EVP_F_EVP_PKEY_GET0_POLY1305), "EVP_PKEY_get0_poly1305"},
    {ERR_FUNC(EVP_F_EVP_PKEY_GET0_RSA), "EVP_PKEY_get0_RSA"},
    {ERR_FUNC(EVP_F_EVP_PKEY_GET0_SIPHASH), "EVP_PKEY_get0_siphash"},
    {ERR_FUNC(EVP_F_EVP_PKEY_KEYGEN), "EVP_PKEY_keygen"},
    {ERR_FUNC(EVP_F_EVP_PKEY_KEYGEN_INIT), "EVP_PKEY_keygen_init"},
    {ERR_FUNC(EVP_F_EVP_PKEY_NEW), "EVP_PKEY_new"},
@@ -119,6 +120,7 @@ static ERR_STRING_DATA EVP_str_reasons[] = {
    {ERR_REASON(EVP_R_EXPECTING_A_DSA_KEY), "expecting a dsa key"},
    {ERR_REASON(EVP_R_EXPECTING_A_EC_KEY), "expecting a ec key"},
    {ERR_REASON(EVP_R_EXPECTING_A_POLY1305_KEY), "expecting a poly1305 key"},
    {ERR_REASON(EVP_R_EXPECTING_A_SIPHASH_KEY), "expecting a siphash key"},
    {ERR_REASON(EVP_R_FIPS_MODE_NOT_SUPPORTED), "fips mode not supported"},
    {ERR_REASON(EVP_R_ILLEGAL_SCRYPT_PARAMETERS),
     "illegal scrypt parameters"},
Loading