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

Side by Side Diff: net/quic/crypto/null_decrypter.h

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 years 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
« no previous file with comments | « net/quic/crypto/local_strike_register_client_test.cc ('k') | net/quic/crypto/null_decrypter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef NET_QUIC_CRYPTO_NULL_DECRYPTER_H_ 5 #ifndef NET_QUIC_CRYPTO_NULL_DECRYPTER_H_
6 #define NET_QUIC_CRYPTO_NULL_DECRYPTER_H_ 6 #define NET_QUIC_CRYPTO_NULL_DECRYPTER_H_
7 7
8 #include <stddef.h>
9 #include <stdint.h>
10
8 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/macros.h"
9 #include "net/base/net_export.h" 13 #include "net/base/net_export.h"
10 #include "net/quic/crypto/quic_decrypter.h" 14 #include "net/quic/crypto/quic_decrypter.h"
11 15
12 namespace net { 16 namespace net {
13 17
14 class QuicDataReader; 18 class QuicDataReader;
15 19
16 // A NullDecrypter is a QuicDecrypter used before a crypto negotiation 20 // A NullDecrypter is a QuicDecrypter used before a crypto negotiation
17 // has occurred. It does not actually decrypt the payload, but does 21 // has occurred. It does not actually decrypt the payload, but does
18 // verify a hash (fnv128) over both the payload and associated data. 22 // verify a hash (fnv128) over both the payload and associated data.
19 class NET_EXPORT_PRIVATE NullDecrypter : public QuicDecrypter { 23 class NET_EXPORT_PRIVATE NullDecrypter : public QuicDecrypter {
20 public: 24 public:
21 NullDecrypter(); 25 NullDecrypter();
22 ~NullDecrypter() override {} 26 ~NullDecrypter() override {}
23 27
24 // QuicDecrypter implementation 28 // QuicDecrypter implementation
25 bool SetKey(base::StringPiece key) override; 29 bool SetKey(base::StringPiece key) override;
26 bool SetNoncePrefix(base::StringPiece nonce_prefix) override; 30 bool SetNoncePrefix(base::StringPiece nonce_prefix) override;
27 bool DecryptPacket(QuicPacketNumber packet_number, 31 bool DecryptPacket(QuicPacketNumber packet_number,
28 const base::StringPiece& associated_data, 32 const base::StringPiece& associated_data,
29 const base::StringPiece& ciphertext, 33 const base::StringPiece& ciphertext,
30 char* output, 34 char* output,
31 size_t* output_length, 35 size_t* output_length,
32 size_t max_output_length) override; 36 size_t max_output_length) override;
33 base::StringPiece GetKey() const override; 37 base::StringPiece GetKey() const override;
34 base::StringPiece GetNoncePrefix() const override; 38 base::StringPiece GetNoncePrefix() const override;
35 39
36 const char* cipher_name() const override; 40 const char* cipher_name() const override;
37 uint32 cipher_id() const override; 41 uint32_t cipher_id() const override;
38 42
39 private: 43 private:
40 bool ReadHash(QuicDataReader* reader, uint128* hash); 44 bool ReadHash(QuicDataReader* reader, uint128* hash);
41 uint128 ComputeHash(const base::StringPiece data1, 45 uint128 ComputeHash(const base::StringPiece data1,
42 const base::StringPiece data2) const; 46 const base::StringPiece data2) const;
43 47
44 DISALLOW_COPY_AND_ASSIGN(NullDecrypter); 48 DISALLOW_COPY_AND_ASSIGN(NullDecrypter);
45 }; 49 };
46 50
47 } // namespace net 51 } // namespace net
48 52
49 #endif // NET_QUIC_CRYPTO_NULL_DECRYPTER_H_ 53 #endif // NET_QUIC_CRYPTO_NULL_DECRYPTER_H_
OLDNEW
« no previous file with comments | « net/quic/crypto/local_strike_register_client_test.cc ('k') | net/quic/crypto/null_decrypter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698