diff options
author | johannes.rudolph@googlemail.com <johannes.rudolph@googlemail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-27 18:03:48 +0000 |
---|---|---|
committer | johannes.rudolph@googlemail.com <johannes.rudolph@googlemail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-27 18:03:48 +0000 |
commit | 40a2fdf2941cd5153daffaf72f77092eb7e3fc0f (patch) | |
tree | d764c02e71638ef005d0f4c14eb173e8ca2d7ff3 /net | |
parent | 064701f25c3d22cb54079c8202e927d676afc70c (diff) | |
download | chromium_src-40a2fdf2941cd5153daffaf72f77092eb7e3fc0f.zip chromium_src-40a2fdf2941cd5153daffaf72f77092eb7e3fc0f.tar.gz chromium_src-40a2fdf2941cd5153daffaf72f77092eb7e3fc0f.tar.bz2 |
use the correct constant in the FNV1a_128_Hash function as defined in the specification
TEST=Use a third-party fnv1a-128 implementation to verify the test values.
BUG=
Review URL: https://chromiumcodereview.appspot.com/12340054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184988 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/quic/crypto/null_decrypter_test.cc | 8 | ||||
-rw-r--r-- | net/quic/crypto/null_encrypter_test.cc | 8 | ||||
-rw-r--r-- | net/quic/quic_utils.cc | 7 |
3 files changed, 12 insertions, 11 deletions
diff --git a/net/quic/crypto/null_decrypter_test.cc b/net/quic/crypto/null_decrypter_test.cc index 3d201fe..56aa531 100644 --- a/net/quic/crypto/null_decrypter_test.cc +++ b/net/quic/crypto/null_decrypter_test.cc @@ -13,10 +13,10 @@ namespace test { TEST(NullDecrypterTest, Decrypt) { unsigned char expected[] = { // fnv hash - 0x47, 0x11, 0xea, 0x5f, - 0xcf, 0x1d, 0x66, 0x5b, - 0xba, 0xf0, 0xbc, 0xfd, - 0x88, 0x79, 0xca, 0x37, + 0xa0, 0x6f, 0x44, 0x8a, + 0x44, 0xf8, 0x18, 0x3b, + 0x47, 0x91, 0xb2, 0x13, + 0x6b, 0x09, 0xbb, 0xae, // payload 'g', 'o', 'o', 'd', 'b', 'y', 'e', '!', diff --git a/net/quic/crypto/null_encrypter_test.cc b/net/quic/crypto/null_encrypter_test.cc index 328c738..df9bcdc 100644 --- a/net/quic/crypto/null_encrypter_test.cc +++ b/net/quic/crypto/null_encrypter_test.cc @@ -13,10 +13,10 @@ namespace test { TEST(NullEncrypterTest, Encrypt) { unsigned char expected[] = { // fnv hash - 0x47, 0x11, 0xea, 0x5f, - 0xcf, 0x1d, 0x66, 0x5b, - 0xba, 0xf0, 0xbc, 0xfd, - 0x88, 0x79, 0xca, 0x37, + 0xa0, 0x6f, 0x44, 0x8a, + 0x44, 0xf8, 0x18, 0x3b, + 0x47, 0x91, 0xb2, 0x13, + 0x6b, 0x09, 0xbb, 0xae, // payload 'g', 'o', 'o', 'd', 'b', 'y', 'e', '!', diff --git a/net/quic/quic_utils.cc b/net/quic/quic_utils.cc index 0628dee..ae52876 100644 --- a/net/quic/quic_utils.cc +++ b/net/quic/quic_utils.cc @@ -20,11 +20,12 @@ size_t QuicUtils::StreamFramePacketOverhead(int num_frames) { // static uint128 QuicUtils::FNV1a_128_Hash(const char* data, int len) { // The following two constants are defined as part of the hash algorithm. + // see http://www.isthe.com/chongo/tech/comp/fnv/ // 309485009821345068724781371 const uint128 kPrime(16777216, 315); - // 14406626329776981559649562966706236762 - const uint128 kOffset(GG_UINT64_C(780984778246553632), - GG_UINT64_C(4400696054689967450)); + // 144066263297769815596495629667062367629 + const uint128 kOffset(GG_UINT64_C(7809847782465536322), + GG_UINT64_C(7113472399480571277)); const uint8* octets = reinterpret_cast<const uint8*>(data); |