| 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_DECRYPTER_H_ | 5 #ifndef NET_QUIC_CRYPTO_AEAD_BASE_DECRYPTER_H_ |
| 6 #define NET_QUIC_CRYPTO_AEAD_BASE_DECRYPTER_H_ | 6 #define NET_QUIC_CRYPTO_AEAD_BASE_DECRYPTER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "net/quic/crypto/quic_decrypter.h" | 9 #include "net/quic/crypto/quic_decrypter.h" |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #else | 33 #else |
| 34 AeadBaseDecrypter(CK_MECHANISM_TYPE aead_mechanism, | 34 AeadBaseDecrypter(CK_MECHANISM_TYPE aead_mechanism, |
| 35 PK11_DecryptFunction pk11_decrypt, | 35 PK11_DecryptFunction pk11_decrypt, |
| 36 size_t key_size, | 36 size_t key_size, |
| 37 size_t auth_tag_size, | 37 size_t auth_tag_size, |
| 38 size_t nonce_prefix_size); | 38 size_t nonce_prefix_size); |
| 39 #endif | 39 #endif |
| 40 virtual ~AeadBaseDecrypter(); | 40 virtual ~AeadBaseDecrypter(); |
| 41 | 41 |
| 42 // QuicDecrypter implementation | 42 // QuicDecrypter implementation |
| 43 virtual bool SetKey(base::StringPiece key) OVERRIDE; | 43 virtual bool SetKey(base::StringPiece key) override; |
| 44 virtual bool SetNoncePrefix(base::StringPiece nonce_prefix) OVERRIDE; | 44 virtual bool SetNoncePrefix(base::StringPiece nonce_prefix) override; |
| 45 virtual bool Decrypt(base::StringPiece nonce, | 45 virtual bool Decrypt(base::StringPiece nonce, |
| 46 base::StringPiece associated_data, | 46 base::StringPiece associated_data, |
| 47 base::StringPiece ciphertext, | 47 base::StringPiece ciphertext, |
| 48 unsigned char* output, | 48 unsigned char* output, |
| 49 size_t* output_length) OVERRIDE; | 49 size_t* output_length) override; |
| 50 virtual QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number, | 50 virtual QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number, |
| 51 base::StringPiece associated_data, | 51 base::StringPiece associated_data, |
| 52 base::StringPiece ciphertext) OVERRIDE; | 52 base::StringPiece ciphertext) override; |
| 53 virtual base::StringPiece GetKey() const OVERRIDE; | 53 virtual base::StringPiece GetKey() const override; |
| 54 virtual base::StringPiece GetNoncePrefix() const OVERRIDE; | 54 virtual base::StringPiece GetNoncePrefix() const override; |
| 55 | 55 |
| 56 protected: | 56 protected: |
| 57 // Make these constants available to the subclasses so that the subclasses | 57 // Make these constants available to the subclasses so that the subclasses |
| 58 // can assert at compile time their key_size_ and nonce_prefix_size_ do not | 58 // can assert at compile time their key_size_ and nonce_prefix_size_ do not |
| 59 // exceed the maximum. | 59 // exceed the maximum. |
| 60 static const size_t kMaxKeySize = 32; | 60 static const size_t kMaxKeySize = 32; |
| 61 static const size_t kMaxNoncePrefixSize = 4; | 61 static const size_t kMaxNoncePrefixSize = 4; |
| 62 | 62 |
| 63 #if !defined(USE_OPENSSL) | 63 #if !defined(USE_OPENSSL) |
| 64 struct AeadParams { | 64 struct AeadParams { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 #if defined(USE_OPENSSL) | 98 #if defined(USE_OPENSSL) |
| 99 ScopedEVPAEADCtx ctx_; | 99 ScopedEVPAEADCtx ctx_; |
| 100 #endif | 100 #endif |
| 101 | 101 |
| 102 DISALLOW_COPY_AND_ASSIGN(AeadBaseDecrypter); | 102 DISALLOW_COPY_AND_ASSIGN(AeadBaseDecrypter); |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 } // namespace net | 105 } // namespace net |
| 106 | 106 |
| 107 #endif // NET_QUIC_CRYPTO_AEAD_BASE_DECRYPTER_H_ | 107 #endif // NET_QUIC_CRYPTO_AEAD_BASE_DECRYPTER_H_ |
| OLD | NEW |