OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_AEAD_BASE_ENCRYPTER_H_ | 5 #ifndef NET_QUIC_CRYPTO_AEAD_BASE_ENCRYPTER_H_ |
6 #define NET_QUIC_CRYPTO_AEAD_BASE_ENCRYPTER_H_ | 6 #define NET_QUIC_CRYPTO_AEAD_BASE_ENCRYPTER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "net/quic/crypto/quic_encrypter.h" | 9 #include "net/quic/crypto/quic_encrypter.h" |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 #endif | 39 #endif |
40 ~AeadBaseEncrypter() override; | 40 ~AeadBaseEncrypter() override; |
41 | 41 |
42 // QuicEncrypter implementation | 42 // QuicEncrypter implementation |
43 bool SetKey(base::StringPiece key) override; | 43 bool SetKey(base::StringPiece key) override; |
44 bool SetNoncePrefix(base::StringPiece nonce_prefix) override; | 44 bool SetNoncePrefix(base::StringPiece nonce_prefix) override; |
45 bool Encrypt(base::StringPiece nonce, | 45 bool Encrypt(base::StringPiece nonce, |
46 base::StringPiece associated_data, | 46 base::StringPiece associated_data, |
47 base::StringPiece plaintext, | 47 base::StringPiece plaintext, |
48 unsigned char* output) override; | 48 unsigned char* output) override; |
49 QuicData* EncryptPacket(QuicPacketSequenceNumber sequence_number, | 49 bool EncryptPacket(QuicPacketSequenceNumber sequence_number, |
50 base::StringPiece associated_data, | 50 base::StringPiece associated_data, |
51 base::StringPiece plaintext) override; | 51 base::StringPiece plaintext, |
| 52 char* output, |
| 53 size_t* output_length, |
| 54 size_t max_output_length) override; |
52 size_t GetKeySize() const override; | 55 size_t GetKeySize() const override; |
53 size_t GetNoncePrefixSize() const override; | 56 size_t GetNoncePrefixSize() const override; |
54 size_t GetMaxPlaintextSize(size_t ciphertext_size) const override; | 57 size_t GetMaxPlaintextSize(size_t ciphertext_size) const override; |
55 size_t GetCiphertextSize(size_t plaintext_size) const override; | 58 size_t GetCiphertextSize(size_t plaintext_size) const override; |
56 base::StringPiece GetKey() const override; | 59 base::StringPiece GetKey() const override; |
57 base::StringPiece GetNoncePrefix() const override; | 60 base::StringPiece GetNoncePrefix() const override; |
58 | 61 |
59 protected: | 62 protected: |
60 // Make these constants available to the subclasses so that the subclasses | 63 // Make these constants available to the subclasses so that the subclasses |
61 // can assert at compile time their key_size_ and nonce_prefix_size_ do not | 64 // can assert at compile time their key_size_ and nonce_prefix_size_ do not |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 #if defined(USE_OPENSSL) | 104 #if defined(USE_OPENSSL) |
102 ScopedEVPAEADCtx ctx_; | 105 ScopedEVPAEADCtx ctx_; |
103 #endif | 106 #endif |
104 | 107 |
105 DISALLOW_COPY_AND_ASSIGN(AeadBaseEncrypter); | 108 DISALLOW_COPY_AND_ASSIGN(AeadBaseEncrypter); |
106 }; | 109 }; |
107 | 110 |
108 } // namespace net | 111 } // namespace net |
109 | 112 |
110 #endif // NET_QUIC_CRYPTO_AEAD_BASE_ENCRYPTER_H_ | 113 #endif // NET_QUIC_CRYPTO_AEAD_BASE_ENCRYPTER_H_ |
OLD | NEW |