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 #include <openssl/err.h> | 5 #include <openssl/err.h> |
6 #include <openssl/evp.h> | 6 #include <openssl/evp.h> |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "net/quic/crypto/aead_base_encrypter.h" | 11 #include "net/quic/core/crypto/aead_base_encrypter.h" |
12 #include "net/quic/quic_flags.h" | 12 #include "net/quic/core/quic_flags.h" |
13 #include "net/quic/quic_utils.h" | 13 #include "net/quic/core/quic_utils.h" |
14 | 14 |
15 using base::StringPiece; | 15 using base::StringPiece; |
16 | 16 |
17 namespace net { | 17 namespace net { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // The maximum size in bytes of the nonce, including 8 bytes of sequence number. | 21 // The maximum size in bytes of the nonce, including 8 bytes of sequence number. |
22 // ChaCha20 uses only the 8 byte sequence number and AES-GCM uses 12 bytes. | 22 // ChaCha20 uses only the 8 byte sequence number and AES-GCM uses 12 bytes. |
23 const size_t kMaxNonceSize = 12; | 23 const size_t kMaxNonceSize = 12; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 StringPiece AeadBaseEncrypter::GetNoncePrefix() const { | 156 StringPiece AeadBaseEncrypter::GetNoncePrefix() const { |
157 if (nonce_prefix_size_ == 0) { | 157 if (nonce_prefix_size_ == 0) { |
158 return StringPiece(); | 158 return StringPiece(); |
159 } | 159 } |
160 return StringPiece(reinterpret_cast<const char*>(nonce_prefix_), | 160 return StringPiece(reinterpret_cast<const char*>(nonce_prefix_), |
161 nonce_prefix_size_); | 161 nonce_prefix_size_); |
162 } | 162 } |
163 | 163 |
164 } // namespace net | 164 } // namespace net |
OLD | NEW |