OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/crypto/null_decrypter.h" | 5 #include "net/quic/crypto/null_decrypter.h" |
| 6 |
| 7 #include <stdint.h> |
| 8 |
6 #include "net/quic/quic_utils.h" | 9 #include "net/quic/quic_utils.h" |
7 #include "net/quic/quic_data_reader.h" | 10 #include "net/quic/quic_data_reader.h" |
8 | 11 |
9 using base::StringPiece; | 12 using base::StringPiece; |
10 using std::string; | 13 using std::string; |
11 | 14 |
12 namespace net { | 15 namespace net { |
13 | 16 |
14 NullDecrypter::NullDecrypter() {} | 17 NullDecrypter::NullDecrypter() {} |
15 | 18 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 *hash = hi; | 63 *hash = hi; |
61 *hash <<= 64; | 64 *hash <<= 64; |
62 *hash += lo; | 65 *hash += lo; |
63 return true; | 66 return true; |
64 } | 67 } |
65 | 68 |
66 uint128 NullDecrypter::ComputeHash(const StringPiece& data1, | 69 uint128 NullDecrypter::ComputeHash(const StringPiece& data1, |
67 const StringPiece& data2) const { | 70 const StringPiece& data2) const { |
68 uint128 correct_hash = QuicUtils::FNV1a_128_Hash_Two( | 71 uint128 correct_hash = QuicUtils::FNV1a_128_Hash_Two( |
69 data1.data(), data1.length(), data2.data(), data2.length()); | 72 data1.data(), data1.length(), data2.data(), data2.length()); |
70 uint128 mask(GG_UINT64_C(0x0), GG_UINT64_C(0xffffffff)); | 73 uint128 mask(UINT64_C(0x0), UINT64_C(0xffffffff)); |
71 mask <<= 96; | 74 mask <<= 96; |
72 correct_hash &= ~mask; | 75 correct_hash &= ~mask; |
73 return correct_hash; | 76 return correct_hash; |
74 } | 77 } |
75 | 78 |
76 } // namespace net | 79 } // namespace net |
OLD | NEW |