xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/quic/core/crypto/quic_crypter.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright (c) 2019 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 #include "quiche/quic/core/crypto/quic_crypter.h"
6 
7 #include "absl/strings/string_view.h"
8 
9 namespace quic {
10 
SetNoncePrefixOrIV(const ParsedQuicVersion & version,absl::string_view nonce_prefix_or_iv)11 bool QuicCrypter::SetNoncePrefixOrIV(const ParsedQuicVersion& version,
12                                      absl::string_view nonce_prefix_or_iv) {
13   if (version.UsesInitialObfuscators()) {
14     return SetIV(nonce_prefix_or_iv);
15   }
16   return SetNoncePrefix(nonce_prefix_or_iv);
17 }
18 
19 }  // namespace quic
20