Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: net/quic/core/crypto/null_decrypter.cc

Issue 2340583002: Make DiversificationNonce a std::array (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/core/crypto/null_decrypter.h" 5 #include "net/quic/core/crypto/null_decrypter.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "net/quic/core/quic_bug_tracker.h" 9 #include "net/quic/core/quic_bug_tracker.h"
10 #include "net/quic/core/quic_data_reader.h" 10 #include "net/quic/core/quic_data_reader.h"
(...skipping 12 matching lines...) Expand all
23 23
24 bool NullDecrypter::SetNoncePrefix(StringPiece nonce_prefix) { 24 bool NullDecrypter::SetNoncePrefix(StringPiece nonce_prefix) {
25 return nonce_prefix.empty(); 25 return nonce_prefix.empty();
26 } 26 }
27 27
28 bool NullDecrypter::SetPreliminaryKey(StringPiece key) { 28 bool NullDecrypter::SetPreliminaryKey(StringPiece key) {
29 QUIC_BUG << "Should not be called"; 29 QUIC_BUG << "Should not be called";
30 return false; 30 return false;
31 } 31 }
32 32
33 bool NullDecrypter::SetDiversificationNonce(DiversificationNonce nonce) { 33 bool NullDecrypter::SetDiversificationNonce(const DiversificationNonce& nonce) {
34 QUIC_BUG << "Should not be called"; 34 QUIC_BUG << "Should not be called";
35 return true; 35 return true;
36 } 36 }
37 37
38 bool NullDecrypter::DecryptPacket(QuicPathId /*path_id*/, 38 bool NullDecrypter::DecryptPacket(QuicPathId /*path_id*/,
39 QuicPacketNumber /*packet_number*/, 39 QuicPacketNumber /*packet_number*/,
40 StringPiece associated_data, 40 StringPiece associated_data,
41 StringPiece ciphertext, 41 StringPiece ciphertext,
42 char* output, 42 char* output,
43 size_t* output_length, 43 size_t* output_length,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 const StringPiece data2) const { 95 const StringPiece data2) const {
96 uint128 correct_hash = QuicUtils::FNV1a_128_Hash_Two( 96 uint128 correct_hash = QuicUtils::FNV1a_128_Hash_Two(
97 data1.data(), data1.length(), data2.data(), data2.length()); 97 data1.data(), data1.length(), data2.data(), data2.length());
98 uint128 mask(UINT64_C(0x0), UINT64_C(0xffffffff)); 98 uint128 mask(UINT64_C(0x0), UINT64_C(0xffffffff));
99 mask <<= 96; 99 mask <<= 96;
100 correct_hash &= ~mask; 100 correct_hash &= ~mask;
101 return correct_hash; 101 return correct_hash;
102 } 102 }
103 103
104 } // namespace net 104 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/crypto/null_decrypter.h ('k') | net/quic/core/crypto/quic_crypto_server_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698