| 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 #ifndef NET_QUIC_CRYPTO_QUIC_DECRYPTER_H_ | 5 #ifndef NET_QUIC_CRYPTO_QUIC_DECRYPTER_H_ |
| 6 #define NET_QUIC_CRYPTO_QUIC_DECRYPTER_H_ | 6 #define NET_QUIC_CRYPTO_QUIC_DECRYPTER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // Populates |output| with the decrypted |ciphertext| and populates | 45 // Populates |output| with the decrypted |ciphertext| and populates |
| 46 // |output_length| with the length. Returns 0 if there is an error. | 46 // |output_length| with the length. Returns 0 if there is an error. |
| 47 // |output| size is specified by |max_output_length| and must be | 47 // |output| size is specified by |max_output_length| and must be |
| 48 // at least as large as the ciphertext. |packet_number| is | 48 // at least as large as the ciphertext. |packet_number| is |
| 49 // appended to the |nonce_prefix| value provided in SetNoncePrefix() | 49 // appended to the |nonce_prefix| value provided in SetNoncePrefix() |
| 50 // to form the nonce. | 50 // to form the nonce. |
| 51 // TODO(wtc): add a way for DecryptPacket to report decryption failure due | 51 // TODO(wtc): add a way for DecryptPacket to report decryption failure due |
| 52 // to non-authentic inputs, as opposed to other reasons for failure. | 52 // to non-authentic inputs, as opposed to other reasons for failure. |
| 53 virtual bool DecryptPacket(QuicPathId path_id, | 53 virtual bool DecryptPacket(QuicPathId path_id, |
| 54 QuicPacketNumber packet_number, | 54 QuicPacketNumber packet_number, |
| 55 const base::StringPiece& associated_data, | 55 base::StringPiece associated_data, |
| 56 const base::StringPiece& ciphertext, | 56 base::StringPiece ciphertext, |
| 57 char* output, | 57 char* output, |
| 58 size_t* output_length, | 58 size_t* output_length, |
| 59 size_t max_output_length) = 0; | 59 size_t max_output_length) = 0; |
| 60 | 60 |
| 61 // The name of the cipher. | 61 // The name of the cipher. |
| 62 virtual const char* cipher_name() const = 0; | 62 virtual const char* cipher_name() const = 0; |
| 63 // The ID of the cipher. Return 0x03000000 ORed with the 'cryptographic suite | 63 // The ID of the cipher. Return 0x03000000 ORed with the 'cryptographic suite |
| 64 // selector'. | 64 // selector'. |
| 65 virtual uint32_t cipher_id() const = 0; | 65 virtual uint32_t cipher_id() const = 0; |
| 66 | 66 |
| 67 // For use by unit tests only. | 67 // For use by unit tests only. |
| 68 virtual base::StringPiece GetKey() const = 0; | 68 virtual base::StringPiece GetKey() const = 0; |
| 69 virtual base::StringPiece GetNoncePrefix() const = 0; | 69 virtual base::StringPiece GetNoncePrefix() const = 0; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace net | 72 } // namespace net |
| 73 | 73 |
| 74 #endif // NET_QUIC_CRYPTO_QUIC_DECRYPTER_H_ | 74 #endif // NET_QUIC_CRYPTO_QUIC_DECRYPTER_H_ |
| OLD | NEW |