OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_QUIC_CRYPTO_QUIC_ENCRYPTER_H_ |
| 6 #define NET_QUIC_CRYPTO_QUIC_ENCRYPTER_H_ |
| 7 |
| 8 #include "net/base/net_export.h" |
| 9 #include "net/quic/crypto/crypto_protocol.h" |
| 10 #include "net/quic/quic_protocol.h" |
| 11 |
| 12 namespace net { |
| 13 |
| 14 class NET_EXPORT_PRIVATE QuicEncrypter { |
| 15 public: |
| 16 virtual ~QuicEncrypter() {} |
| 17 |
| 18 static QuicEncrypter* Create(CryptoTag algorithm); |
| 19 |
| 20 // Returns a newly created QuicData object containing the encrypted |
| 21 // |plaintext| as well as a MAC over both |plaintext| and |associated_data|, |
| 22 // or NULL if there is an error. |
| 23 virtual QuicData* Encrypt(base::StringPiece associated_data, |
| 24 base::StringPiece plaintext) = 0; |
| 25 |
| 26 // Returns the maximum length of plaintext that can be encrypted |
| 27 // to ciphertext no larger than |ciphertext_size|. |
| 28 virtual size_t GetMaxPlaintextSize(size_t ciphertext_size) = 0; |
| 29 |
| 30 // Returns the length of the ciphertext that would be generated by encrypting |
| 31 // to plaintext of size |plaintext_size|. |
| 32 virtual size_t GetCiphertextSize(size_t plaintext_size) = 0; |
| 33 |
| 34 }; |
| 35 |
| 36 } // namespace net |
| 37 |
| 38 #endif // NET_QUIC_CRYPTO_QUIC_ENCRYPTER_H_ |
OLD | NEW |